Fixed memory leak when flow is zeroed out.

This commit is contained in:
Felix Jia
2018-03-26 10:20:03 +13:00
parent 462da90a21
commit 5281fcf3cd
+4
View File
@@ -3275,6 +3275,10 @@ static int ndpi_init_packet_header(struct ndpi_detection_module_struct *ndpi_str
&& flow->packet.tcp->ack == 0
&& flow->init_finished != 0
&& flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
if(flow->http.url)
ndpi_free(flow->http.url);
if(flow->http.content_type)
ndpi_free(flow->http.content_type);
memset(flow, 0, sizeof(*(flow)));
NDPI_LOG_DBG(ndpi_struct,