diff --git a/src/detect-engine-port.c b/src/detect-engine-port.c index ba8ae5c0a5..1e354b62bb 100644 --- a/src/detect-engine-port.c +++ b/src/detect-engine-port.c @@ -1330,6 +1330,9 @@ DetectPort *PortParse(char *str) { /* we dup so we can put a nul-termination in it later */ char *port = portdup; + if (port == NULL) { + goto error; + } /* handle the negation case */ if (port[0] == '!') {