From a56592e556f6cc81c0fb03b46ba29b2b7a9c4493 Mon Sep 17 00:00:00 2001 From: Gerardo Iglesias Galvan Date: Tue, 31 May 2011 18:15:51 -0500 Subject: [PATCH] Make sure we do all after the null check in HTPStateFree --- src/app-layer-htp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 92f3c5cac5..cee64842f9 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -181,12 +181,15 @@ void HTPStateFree(void *state) SCEnter(); HtpState *s = (HtpState *)state; + if (s == NULL) { + SCReturn; + } /* Unset the body inspection */ s->flags &=~ HTP_FLAG_NEW_BODY_SET; /* free the connection parser memory used by HTP library */ - if (s != NULL && s->connp != NULL) { + if (s->connp != NULL) { SCLogDebug("freeing HTP state"); size_t i;