From a42fff541f3a527657eeb05a6a579e68b547b4df Mon Sep 17 00:00:00 2001 From: William Metcalf Date: Wed, 2 Jun 2010 15:06:52 -0500 Subject: [PATCH] fix for potential NULL deref on error in detect-http-method.c --- src/detect-http-method.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); }