From bfc4be230c150ab3a1e1c8df2fdb4605a95a372b Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 11 Mar 2016 09:25:23 +0100 Subject: [PATCH] htp: fix dead code warning (CID 1153933) --- src/app-layer-htp.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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)