]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
log: add NULL ptr guard on fclose when reopening.
authorEmmanuel Roullit <emmanuel.roullit@cognitix.de>
Thu, 28 Mar 2019 08:19:17 +0000 (09:19 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 3 Apr 2019 18:32:42 +0000 (20:32 +0200)
Signed-off-by: Emmanuel Roullit <emmanuel.roullit@cognitix.de>
src/util-logopenfile.c

index 2694aa11f763b98f439c3586bc0a723f55d9caea..f188bb908ef0039d0a396c570ffd6b636992fe1b 100644 (file)
@@ -500,7 +500,9 @@ int SCConfLogReopen(LogFileCtx *log_ctx)
         return -1;
     }
 
-    fclose(log_ctx->fp);
+    if (log_ctx->fp != NULL) {
+        fclose(log_ctx->fp);
+    }
 
     /* Reopen the file. Append is forced in case the file was not
      * moved as part of a rotation process. */