Free flow fix

This commit is contained in:
Luca Deri
2020-12-28 09:32:06 +01:00
parent 9c1827a77b
commit 0fceb6576a
+8 -1
View File
@@ -6301,20 +6301,26 @@ int ndpi_match_bigram(struct ndpi_detection_module_struct *ndpi_str,
void ndpi_free_flow(struct ndpi_flow_struct *flow) { void ndpi_free_flow(struct ndpi_flow_struct *flow) {
if(flow) { if(flow) {
u_int is_quic;
if(flow->http.url) if(flow->http.url)
ndpi_free(flow->http.url); ndpi_free(flow->http.url);
if(flow->http.content_type) if(flow->http.content_type)
ndpi_free(flow->http.content_type); ndpi_free(flow->http.content_type);
if(flow->http.user_agent) if(flow->http.user_agent)
ndpi_free(flow->http.user_agent); ndpi_free(flow->http.user_agent);
if(flow->kerberos_buf.pktbuf) if(flow->kerberos_buf.pktbuf)
ndpi_free(flow->kerberos_buf.pktbuf); ndpi_free(flow->kerberos_buf.pktbuf);
if(flow_is_proto(flow, NDPI_PROTOCOL_TLS) || 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) if(flow->protos.stun_ssl.ssl.server_names)
ndpi_free(flow->protos.stun_ssl.ssl.server_names); ndpi_free(flow->protos.stun_ssl.ssl.server_names);
if(!is_quic) {
if(flow->protos.stun_ssl.ssl.alpn) if(flow->protos.stun_ssl.ssl.alpn)
ndpi_free(flow->protos.stun_ssl.ssl.alpn); ndpi_free(flow->protos.stun_ssl.ssl.alpn);
@@ -6333,6 +6339,7 @@ void ndpi_free_flow(struct ndpi_flow_struct *flow) {
if(flow->protos.stun_ssl.ssl.encrypted_sni.esni) if(flow->protos.stun_ssl.ssl.encrypted_sni.esni)
ndpi_free(flow->protos.stun_ssl.ssl.encrypted_sni.esni); ndpi_free(flow->protos.stun_ssl.ssl.encrypted_sni.esni);
} }
}
if(flow->l4_proto == IPPROTO_TCP) { if(flow->l4_proto == IPPROTO_TCP) {
if(flow->l4.tcp.tls.message.buffer) if(flow->l4.tcp.tls.message.buffer)