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;