Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
99bc2377
Commit
99bc2377
authored
Apr 21, 2014
by
Hisham Muhammad
Browse files
Fix resource leak detected by cppcheck
parent
af027497
Changes
1
Hide whitespace changes
Inline
Side-by-side
ProcessList.c
View file @
99bc2377
...
...
@@ -669,13 +669,12 @@ static void ProcessList_readOomData(Process* process, const char* dirname, const
if
(
!
file
)
return
;
char
buffer
[
256
];
if
(
!
fgets
(
buffer
,
255
,
file
))
{
return
;
}
unsigned
int
oom
;
int
ok
=
sscanf
(
buffer
,
"%u"
,
&
oom
);
if
(
ok
>=
1
)
{
process
->
oom
=
oom
;
if
(
fgets
(
buffer
,
255
,
file
))
{
unsigned
int
oom
;
int
ok
=
sscanf
(
buffer
,
"%u"
,
&
oom
);
if
(
ok
>=
1
)
{
process
->
oom
=
oom
;
}
}
fclose
(
file
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment