aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremanuele-f <black.silver@hotmail.it>2019-09-27 12:09:51 +0200
committeremanuele-f <black.silver@hotmail.it>2019-09-27 12:09:51 +0200
commit50996469383aa66f3d1686621d5ba97a94765c9d (patch)
treeba8017be0f272e4528c53f5c8aa4f3d9ddcfcc1f
parent277b4a060acda6f0f20b3df03c4c099df6c7b3a9 (diff)
Fix missing strdup on ndpi_load_hostname_category
-rw-r--r--example/ndpiReader.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index f3e26b799..1da0d3b5c 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -1902,9 +1902,11 @@ static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) {
if(sscanf(name, "%d.%d.%d.%d", &fields[0], &fields[1], &fields[2], &fields[3]) == 4)
ndpi_load_ip_category(ndpi_thread_info[thread_id].workflow->ndpi_struct,
name, (ndpi_protocol_category_t)atoi(category));
- else
+ else {
+ /* TODO free the strdup */
ndpi_load_hostname_category(ndpi_thread_info[thread_id].workflow->ndpi_struct,
- name, (ndpi_protocol_category_t)atoi(category));
+ strdup(name), (ndpi_protocol_category_t)atoi(category));
+ }
}
}
}