From b9a2f91a76534a5a4963c1a99a908e5378f11942 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Fri, 9 Nov 2012 16:18:35 +0100 Subject: [PATCH] napatech: treat malloc error --- src/runmode-napatech.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.47.3