Fix file descriptor leak in memtest_test_linux_anonymous_maps (#4241)
when we fail opening `/proc`, we need to close the log file fd.
This commit is contained in:
parent
344e41c922
commit
91cc2059f5
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user