mirror of https://github.com/xzeldon/htop.git
Fix resource leak detected by cppcheck
This commit is contained in:
parent
af02749722
commit
99bc23771f
|
@ -669,14 +669,13 @@ 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;
|
unsigned int oom;
|
||||||
int ok = sscanf(buffer, "%u", &oom);
|
int ok = sscanf(buffer, "%u", &oom);
|
||||||
if (ok >= 1) {
|
if (ok >= 1) {
|
||||||
process->oom = oom;
|
process->oom = oom;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue