diff --git a/src/detect-engine-iponly.c b/src/detect-engine-iponly.c index 8fad7159e2..209839143e 100644 --- a/src/detect-engine-iponly.c +++ b/src/detect-engine-iponly.c @@ -523,8 +523,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; }