aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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));
+ }
}
}
}