mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-04-30 16:09:43 +00:00
added missing free for idle flow in ndpiReader.c
This commit is contained in:
parent
84976ed5dc
commit
4c3d9788dd
2 changed files with 5 additions and 3 deletions
|
|
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue