diff --git a/src/detect-http-method.c b/src/detect-http-method.c index c5bfa326a0..5cd7a3b24e 100644 --- a/src/detect-http-method.c +++ b/src/detect-http-method.c @@ -232,8 +232,10 @@ static int DetectHttpMethodSetup(DetectEngineCtx *de_ctx, Signature *s, char *st error: if (data != NULL) DetectHttpMethodFree(data); - if (nm->ctx != NULL) DetectHttpMethodFree(nm); - if (nm != NULL) SCFree(nm); + if (nm != NULL) { + if (nm->ctx != NULL) DetectHttpMethodFree(nm); + SCFree(nm); + } SCReturnInt(-1); }