]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
htp: fix dead code warning (CID 1153933)
authorVictor Julien <victor@inliniac.net>
Fri, 11 Mar 2016 08:25:23 +0000 (09:25 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 12 Mar 2016 13:18:18 +0000 (14:18 +0100)
src/app-layer-htp.c

index 9a8c27dad562f42ceedc7b66aff81cb051754286..384dbeea31b57f1f65aec4c77310f4e3804c67a1 100644 (file)
@@ -285,8 +285,9 @@ static void *HTPStateAlloc(void)
     SCEnter();
 
     HtpState *s = HTPMalloc(sizeof(HtpState));
-    if (unlikely(s == NULL))
-        goto error;
+    if (unlikely(s == NULL)) {
+        SCReturnPtr(NULL, "void");
+    }
 
     memset(s, 0x00, sizeof(HtpState));
 
@@ -299,13 +300,6 @@ static void *HTPStateAlloc(void)
 #endif
 
     SCReturnPtr((void *)s, "void");
-
-error:
-    if (s != NULL) {
-        HTPFree(s, sizeof(HtpState));
-    }
-
-    SCReturnPtr(NULL, "void");
 }
 
 static void HtpTxUserDataFree(HtpState *state, HtpTxUserData *htud)