aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
authoremanuele-f <black.silver@hotmail.it>2019-10-08 10:12:41 +0200
committeremanuele-f <black.silver@hotmail.it>2019-10-08 10:23:00 +0200
commitb2c8cb655c8d70dafe67bad8da8099a4e8c6a517 (patch)
tree1ccb7cc56a817419f21acaed2029b0a4d43797ce /example/ndpiReader.c
parent4bdbf02c2d5eb871dca4ec620bb66fcc16a74af1 (diff)
ndpi_load_hostname_category now performs strdup on the name argument
This simplifies the API as an application is not required to keep references to the strings to free
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r--example/ndpiReader.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index 2a1bbd8bb..d44fae0d6 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -1903,9 +1903,8 @@ static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) {
ndpi_load_ip_category(ndpi_thread_info[thread_id].workflow->ndpi_struct,
name, (ndpi_protocol_category_t)atoi(category));
else {
- /* TODO free the strdup */
ndpi_load_hostname_category(ndpi_thread_info[thread_id].workflow->ndpi_struct,
- strdup(name), (ndpi_protocol_category_t)atoi(category));
+ name, (ndpi_protocol_category_t)atoi(category));
}
}
}