diff options
author | Toni <matzeton@googlemail.com> | 2021-01-04 12:47:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-04 12:47:05 +0100 |
commit | 53ee6db795ae237d1a32818045c754dc912ef2e5 (patch) | |
tree | fc1741ac0eeb50d0e67c97292d2adc8803945b6a /src/lib/ndpi_main.c | |
parent | 3bb12fde6357136c8309e05bd08134f9440bb8ad (diff) |
Added a new API function `ndpi_free_flow_data' which free's all members of ndpi_flow_struct but not the struct itself. (#1101)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 9fc40eb1c..6765c26d6 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6310,7 +6310,7 @@ int ndpi_match_bigram(struct ndpi_detection_module_struct *ndpi_str, /* ****************************************************** */ -void ndpi_free_flow(struct ndpi_flow_struct *flow) { +void ndpi_free_flow_data(struct ndpi_flow_struct *flow) { if(flow) { u_int is_quic = flow_is_proto(flow, NDPI_PROTOCOL_QUIC); @@ -6355,7 +6355,12 @@ void ndpi_free_flow(struct ndpi_flow_struct *flow) { if(flow->l4.tcp.tls.message.buffer) ndpi_free(flow->l4.tcp.tls.message.buffer); } + } +} +void ndpi_free_flow(struct ndpi_flow_struct *flow) { + if (flow) { + ndpi_free_flow_data(flow); ndpi_free(flow); } } |