diff options
author | Luca Deri <deri@ntop.org> | 2020-12-28 09:32:06 +0100 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-12-28 09:32:06 +0100 |
commit | 0fceb6576aeb76b78ad9c19c86830fba694cfd5d (patch) | |
tree | 3d41e7eb6d9caffc8320b2d353ae6573ab93a601 /src | |
parent | 9c1827a77b5cb83c6b7195fcfd34207dedf3ecec (diff) |
Free flow fix
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ndpi_main.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 9a9481fa2..1c08a596a 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -6301,37 +6301,44 @@ int ndpi_match_bigram(struct ndpi_detection_module_struct *ndpi_str, void ndpi_free_flow(struct ndpi_flow_struct *flow) { if(flow) { + u_int is_quic; + if(flow->http.url) ndpi_free(flow->http.url); + if(flow->http.content_type) ndpi_free(flow->http.content_type); + if(flow->http.user_agent) ndpi_free(flow->http.user_agent); + if(flow->kerberos_buf.pktbuf) ndpi_free(flow->kerberos_buf.pktbuf); if(flow_is_proto(flow, NDPI_PROTOCOL_TLS) || - flow_is_proto(flow, NDPI_PROTOCOL_QUIC)) { + (is_quic = flow_is_proto(flow, NDPI_PROTOCOL_QUIC))) { if(flow->protos.stun_ssl.ssl.server_names) ndpi_free(flow->protos.stun_ssl.ssl.server_names); - if(flow->protos.stun_ssl.ssl.alpn) - ndpi_free(flow->protos.stun_ssl.ssl.alpn); - - if(flow->protos.stun_ssl.ssl.tls_supported_versions) - ndpi_free(flow->protos.stun_ssl.ssl.tls_supported_versions); - - if(flow->protos.stun_ssl.ssl.issuerDN) - ndpi_free(flow->protos.stun_ssl.ssl.issuerDN); - - if(flow->protos.stun_ssl.ssl.subjectDN) - ndpi_free(flow->protos.stun_ssl.ssl.subjectDN); - - if(flow->l4.tcp.tls.srv_cert_fingerprint_ctx) - ndpi_free(flow->l4.tcp.tls.srv_cert_fingerprint_ctx); - - if(flow->protos.stun_ssl.ssl.encrypted_sni.esni) - ndpi_free(flow->protos.stun_ssl.ssl.encrypted_sni.esni); + if(!is_quic) { + if(flow->protos.stun_ssl.ssl.alpn) + ndpi_free(flow->protos.stun_ssl.ssl.alpn); + + if(flow->protos.stun_ssl.ssl.tls_supported_versions) + ndpi_free(flow->protos.stun_ssl.ssl.tls_supported_versions); + + if(flow->protos.stun_ssl.ssl.issuerDN) + ndpi_free(flow->protos.stun_ssl.ssl.issuerDN); + + if(flow->protos.stun_ssl.ssl.subjectDN) + ndpi_free(flow->protos.stun_ssl.ssl.subjectDN); + + if(flow->l4.tcp.tls.srv_cert_fingerprint_ctx) + ndpi_free(flow->l4.tcp.tls.srv_cert_fingerprint_ctx); + + if(flow->protos.stun_ssl.ssl.encrypted_sni.esni) + ndpi_free(flow->protos.stun_ssl.ssl.encrypted_sni.esni); + } } if(flow->l4_proto == IPPROTO_TCP) { |