From 91957d70a81e7db1145eee4eabf85d75c62040cd Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 2 Nov 2011 18:31:14 +0100 Subject: [PATCH] Fix unittest compiler warning. --- src/detect-ipproto.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/detect-ipproto.c b/src/detect-ipproto.c index 45b2815dec..f2ad922eac 100644 --- a/src/detect-ipproto.c +++ b/src/detect-ipproto.c @@ -628,7 +628,7 @@ end: static int DetectIPProtoTestSetup02(void) { int result = 0; - Signature *sig; + Signature *sig = NULL; char *value_str = "tcp"; struct protoent *pent = getprotobyname(value_str); if (pent == NULL) { @@ -656,7 +656,8 @@ static int DetectIPProtoTestSetup02(void) result = 1; end: - SigFree(sig); + if (sig != NULL) + SigFree(sig); return result; }