From: Victor Julien Date: Fri, 11 Mar 2016 08:25:23 +0000 (+0100) Subject: htp: fix dead code warning (CID 1153933) X-Git-Tag: suricata-3.0.1RC1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfc4be230c150ab3a1e1c8df2fdb4605a95a372b;p=thirdparty%2Fsuricata.git htp: fix dead code warning (CID 1153933) --- diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 9a8c27dad5..384dbeea31 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -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)