diff --git a/src/detect-engine-iponly.c b/src/detect-engine-iponly.c index de3fd94fd4..0c6052cc28 100644 --- a/src/detect-engine-iponly.c +++ b/src/detect-engine-iponly.c @@ -502,8 +502,11 @@ int IPOnlyCIDRListParse(IPOnlyCIDRItem **gh, char *str) { SCLogDebug("gh %p, str %s", gh, str); + if (gh == NULL) + goto error; + *gh = IPOnlyCIDRListParse2(str, 0); - if (gh == NULL) { + if (*gh == NULL) { SCLogDebug("DetectAddressParse2 returned null"); goto error; }