From: Eric Leblond Date: Fri, 9 Nov 2012 15:18:35 +0000 (+0100) Subject: napatech: treat malloc error X-Git-Tag: suricata-1.4beta3~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F190%2Fhead;p=thirdparty%2Fsuricata.git napatech: treat malloc error --- diff --git a/src/runmode-napatech.c b/src/runmode-napatech.c index bd5802bb24..2f6a9d1841 100644 --- a/src/runmode-napatech.c +++ b/src/runmode-napatech.c @@ -127,6 +127,8 @@ void *NapatechConfigParser(const char *device) { // Expect device to be of the form nt%d where %d is the stream id to use int dev_len = strlen(device); struct NapatechStreamDevConf *conf = SCMalloc(sizeof(struct NapatechStreamDevConf)); + if (unlikely(conf == NULL)) + return NULL; if (dev_len < 3 || dev_len > 5) { SCLogError(SC_ERR_NAPATECH_PARSE_CONFIG, "Could not parse config for device: %s - invalid length", device);