Merge pull request #539 from felix-jia/fix-mem-leak

Fixed memory leak when flow is zeroed out.
This commit is contained in:
Luca Deri
2018-04-16 14:19:00 +02:00
committed by GitHub
+4
View File
@@ -3277,6 +3277,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,