]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/nfs: do not free a null pointer
authorPhilippe Antoine <pantoine@oisf.net>
Sun, 23 Jun 2024 20:57:11 +0000 (22:57 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 24 Jun 2024 20:30:12 +0000 (22:30 +0200)
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69840

src/detect-nfs-procedure.c

index 3afa327bec9d934fbb1c0d0399ca191384fd6d49..45d8311103a61041c9aeef1615efec02e73b0c16 100644 (file)
@@ -162,7 +162,7 @@ static int DetectNfsProcedureSetup (DetectEngineCtx *de_ctx, Signature *s,
     dd = DetectNfsProcedureParse(rawstr);
     if (dd == NULL) {
         SCLogError("Parsing \'%s\' failed", rawstr);
-        goto error;
+        return -1;
     }
 
     /* okay so far so good, lets get this into a SigMatch
@@ -171,13 +171,10 @@ static int DetectNfsProcedureSetup (DetectEngineCtx *de_ctx, Signature *s,
     SCLogDebug("low %u hi %u", dd->arg1, dd->arg2);
     if (SigMatchAppendSMToList(de_ctx, s, DETECT_AL_NFS_PROCEDURE, (SigMatchCtx *)dd,
                 g_nfs_request_buffer_id) == NULL) {
-        goto error;
+        DetectNfsProcedureFree(de_ctx, dd);
+        return -1;
     }
     return 0;
-
-error:
-    DetectNfsProcedureFree(de_ctx, dd);
-    return -1;
 }
 
 /**