]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
napatech: treat malloc error 190/head
authorEric Leblond <eric@regit.org>
Fri, 9 Nov 2012 15:18:35 +0000 (16:18 +0100)
committerEric Leblond <eric@regit.org>
Fri, 9 Nov 2012 15:18:35 +0000 (16:18 +0100)
src/runmode-napatech.c

index bd5802bb2492af7a9abc9c3364dac4b9b5dd17f2..2f6a9d18417a14d31e5a457caf1c64ebb69918f9 100644 (file)
@@ -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);