]> granicus.if.org Git - sudo/commitdiff
Avoid calling fclose(NULL) in the error path when we cannot open an
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 17 Sep 2012 14:53:46 +0000 (10:53 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 17 Sep 2012 14:53:46 +0000 (10:53 -0400)
I/O log file.

--HG--
branch : 1.8

plugins/sudoers/sudoreplay.c

index 2abbf1b7cc4c88d68a75c076bf6d3bf7b7bcd0ce..a61c0f5c2bbfc01ea16642109e83d9cb1663efbb 100644 (file)
@@ -884,7 +884,8 @@ parse_logfile(char *logfile)
     debug_return_ptr(li);
 
 bad:
-    fclose(fp);
+    if (fp != NULL)
+       fclose(fp);
     efree(buf);
     free_log_info(li);
     debug_return_ptr(NULL);