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
This commit is contained in:
emanuele-f
2019-10-08 10:23:00 +02:00
parent 4bdbf02c2d
commit b2c8cb655c
3 changed files with 15 additions and 18 deletions
+1 -2
View File
@@ -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));
}
}
}