aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampus <campus@ntop.org>2016-02-18 00:29:06 +0100
committerCampus <campus@ntop.org>2016-02-18 00:29:06 +0100
commit4c3d9788dded5ec40ab28e293100b69f29bfbdca (patch)
tree03d5407fc88febd738eae4889ac016289b995720
parent84976ed5dc001050613667c172709e82f124f36d (diff)
added missing free for idle flow in ndpiReader.c
-rw-r--r--example/ndpiReader.c6
-rw-r--r--src/lib/ndpi_main.c2
2 files changed, 5 insertions, 3 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);
+
}
}
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 994f09848..636d3ca73 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -306,7 +306,7 @@ void* ndpi_calloc(unsigned long count, size_t size) {
/* ****************************************** */
-void ndpi_free(void *ptr) { _ndpi_free(ptr); }
+void ndpi_free(void *ptr) { _ndpi_free(ptr); }
/* ****************************************** */