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:
commit
2cc3216866
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue