mirror of https://github.com/xzeldon/htop.git
Fix resource leak detected by cppcheck
This commit is contained in:
parent
af02749722
commit
99bc23771f
|
@ -669,13 +669,12 @@ static void ProcessList_readOomData(Process* process, const char* dirname, const
|
||||||
if (!file)
|
if (!file)
|
||||||
return;
|
return;
|
||||||
char buffer[256];
|
char buffer[256];
|
||||||
if (!fgets(buffer, 255, file)) {
|
if (fgets(buffer, 255, file)) {
|
||||||
return;
|
unsigned int oom;
|
||||||
}
|
int ok = sscanf(buffer, "%u", &oom);
|
||||||
unsigned int oom;
|
if (ok >= 1) {
|
||||||
int ok = sscanf(buffer, "%u", &oom);
|
process->oom = oom;
|
||||||
if (ok >= 1) {
|
}
|
||||||
process->oom = oom;
|
|
||||||
}
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue