diff options
author | Campus <campus@ntop.org> | 2016-02-18 00:29:06 +0100 |
---|---|---|
committer | Campus <campus@ntop.org> | 2016-02-18 00:29:06 +0100 |
commit | 4c3d9788dded5ec40ab28e293100b69f29bfbdca (patch) | |
tree | 03d5407fc88febd738eae4889ac016289b995720 /example/ndpiReader.c | |
parent | 84976ed5dc001050613667c172709e82f124f36d (diff) |
added missing free for idle flow in ndpiReader.c
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r-- | example/ndpiReader.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); + } } |