--- daq_nfq.c.orig 2015-12-31 10:17:25.295705075 -0800 +++ daq_nfq.c 2015-12-31 10:18:54.427033208 -0800 @@ -592,6 +592,13 @@ free(impl->fcode.bf_insns); impl->filter = strdup(filter); + if ( !impl->filter ) + { + snprintf(errBuf, errMax, + "%s: can't allocate memory for device (%s)\n", + __FUNCTION__, filter); + return DAQ_ERROR; + } impl->fcode = fcode; return DAQ_SUCCESS;