From 4c3d9788dded5ec40ab28e293100b69f29bfbdca Mon Sep 17 00:00:00 2001 From: Campus Date: Thu, 18 Feb 2016 00:29:06 +0100 Subject: added missing free for idle flow in ndpiReader.c --- example/ndpiReader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'example') diff --git a/example/ndpiReader.c b/example/ndpiReader.c index bb6ee81c8..b334486e1 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -592,8 +592,8 @@ static void printFlow(u_int16_t thread_id, struct ndpi_flow *flow) { static void free_ndpi_flow(struct ndpi_flow *flow) { if(flow->ndpi_flow) { ndpi_free_flow(flow->ndpi_flow); flow->ndpi_flow = NULL; } - if(flow->src_id) { ndpi_free(flow->src_id); flow->src_id = NULL; } - if(flow->dst_id) { ndpi_free(flow->dst_id); flow->dst_id = NULL; } + if(flow->src_id) { ndpi_free(flow->src_id); flow->src_id = NULL; } + if(flow->dst_id) { ndpi_free(flow->dst_id); flow->dst_id = NULL; } } @@ -1111,6 +1111,7 @@ static unsigned int packet_processing(u_int16_t thread_id, /* free the memory associated to idle flow in "idle_flows" - (see struct reader thread)*/ free_ndpi_flow(ndpi_thread_info[thread_id].idle_flows[ndpi_thread_info[thread_id].num_idle_flows]); + ndpi_free(ndpi_thread_info[thread_id].idle_flows[ndpi_thread_info[thread_id].num_idle_flows]); } if(++ndpi_thread_info[thread_id].idle_scan_idx == NUM_ROOTS) ndpi_thread_info[thread_id].idle_scan_idx = 0; @@ -1452,6 +1453,7 @@ static void printResults(u_int64_t tot_usec) { static void closePcapFile(u_int16_t thread_id) { if(ndpi_thread_info[thread_id]._pcap_handle != NULL) { pcap_close(ndpi_thread_info[thread_id]._pcap_handle); + } } -- cgit v1.2.3