From 2443ff21fa079bacce479c6078f5a406373f219e Mon Sep 17 00:00:00 2001 From: BlackLight Date: Thu, 17 Feb 2011 04:01:08 +0100 Subject: [PATCH] Fixing a tiny memory leak in DOT generation --- correlation.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/correlation.c b/correlation.c index c911d72..34a65bc 100644 --- a/correlation.c +++ b/correlation.c @@ -112,8 +112,9 @@ __AI_correlated_alerts_to_dot ( AI_alert_correlation *corr, FILE *fp ) snprintf ( dst_port2, sizeof ( dst_port2 ), "%d", ntohs ( corr->key.b->tcp_dst_port )); time1 = strdup ( ctime ( &(corr->key.a->timestamp )) ); - time2 = strdup ( ctime ( &(corr->key.b->timestamp )) ); time1[strlen(time1)-1] = 0; + + time2 = strdup ( ctime ( &(corr->key.b->timestamp )) ); time2[strlen(time2)-1] = 0; fprintf ( fp, @@ -137,6 +138,9 @@ __AI_correlated_alerts_to_dot ( AI_alert_correlation *corr, FILE *fp ) time2, corr->key.b->grouped_alerts_count ); + + free ( time1 ); + free ( time2 ); } /* ----- end of function __AI_correlated_alerts_to_dot ----- */ /**