Unverified Commit 91cc2059 authored by footpatch's avatar footpatch Committed by GitHub
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
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment