Merge "Always free after getline()." am: d06cd4a765

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2170542

Change-Id: I1e6ad66a124ee6faad288df20289cf435bf330b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Elliott Hughes 2022-08-01 18:16:39 +00:00 committed by Automerger Merge Worker
commit 2cc3216866

View file

@ -44,8 +44,8 @@ int __get_cpu_count(const char* sys_file) {
size_t allocated_size = 0;
if (getline(&line, &allocated_size, fp) != -1) {
cpu_count = GetCpuCountFromString(line);
free(line);
}
free(line);
fclose(fp);
}
return cpu_count;