[Snort-devel] does alertAdd() free pointer after logging?

Mohiuddin Ebna Kawsar mohiuddin.kawsar at ...2499...
Mon Mar 2 11:45:37 EST 2015


Hi,

I was logging msg from my dynamic_preprocessor by
##########################################################
int a ,b;
a = getSize();
b= getSize();
static char* msg = 0;
msg = calloc(strlen(TEST_EVENT_DETECT_STR) + (2 * 10) + 1, sizeof(char*));
snprintf(msg,strlen(TEST_EVENT_DETECT_STR) + (2 * 10),
TEST_EVENT_DETECT_STR, a, b);
_dpd.alertAdd(GENERATOR_SPP_TEST, TEST_EVENT_DETECT, TEST_EVENT_DETECT_REV,
0, 1, msg, 0 );
##############################################################

my question is should i free msg, or _dpd.alertAdd() have own
implementation to free it?
because while i free msg i don't see any msg in my log file.

Regards
kawsar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.snort.org/pipermail/snort-devel/attachments/20150302/398ad78f/attachment.html>


More information about the Snort-devel mailing list