Free flow fix

This commit is contained in:
Luca Deri 2020-12-28 09:32:06 +01:00
parent 9c1827a77b
commit 0fceb6576a

View file

@ -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) {