From f000b70b9ac817bbc94e3fe69cb8e5ddd64cd1bd Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 23 Oct 2018 14:10:18 +0200 Subject: [PATCH] ipproto: fix memleak in error case --- src/detect-ipproto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/detect-ipproto.c b/src/detect-ipproto.c index 0eba42e6ca..f641f4520d 100644 --- a/src/detect-ipproto.c +++ b/src/detect-ipproto.c @@ -184,12 +184,11 @@ static int DetectIPProtoTypePresentForOP(Signature *s, uint8_t op) static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, const char *optstr) { SigMatch *sm = NULL; - DetectIPProtoData *data = NULL; int i; - data = DetectIPProtoParse(optstr); + DetectIPProtoData *data = DetectIPProtoParse(optstr); if (data == NULL) { - goto error; + return -1; } /* Reset our "any" (or "ip") state: for ipv4, ipv6 and ip cases, the bitfield @@ -422,6 +421,7 @@ static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, const char error: + DetectIPProtoFree(data); return -1; } -- 2.47.2