Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
91cc2059
Unverified
Commit
91cc2059
authored
Feb 06, 2022
by
footpatch
Committed by
GitHub
Feb 06, 2022
Browse files
Fix file descriptor leak in memtest_test_linux_anonymous_maps (#4241)
when we fail opening `/proc`, we need to close the log file fd.
parent
344e41c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/debug.c
View file @
91cc2059
...
...
@@ -1764,7 +1764,10 @@ int memtest_test_linux_anonymous_maps(void) {
if
(
!
fd
)
return
0
;
fp
=
fopen
(
"/proc/self/maps"
,
"r"
);
if
(
!
fp
)
return
0
;
if
(
!
fp
)
{
closeDirectLogFiledes
(
fd
);
return
0
;
}
while
(
fgets
(
line
,
sizeof
(
line
),
fp
)
!=
NULL
)
{
char
*
start
,
*
end
,
*
p
=
line
;
...
...
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