aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2019-08-29 15:47:34 +0200
committerLuca Deri <deri@ntop.org>2019-08-29 15:47:34 +0200
commit536b5207500cb7a7139c315bcd9bb85dd2276675 (patch)
tree4b3080d2e29ae79e084720393c312767c8a68e1f /src/lib
parent8b8fd2562622834d9a16ae871489be13f3b63191 (diff)
Added stub for ndpi_free_memory_at_termination() (TODO)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ndpi_main.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index c8e5adaea..d9b108371 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -450,16 +450,34 @@ static int ndpi_string_to_automa(struct ndpi_detection_module_struct *ndpi_struc
/* ****************************************************** */
+/*
+ TODO
+ This function should free the memory during program termination
+
+ */
+static void ndpi_free_memory_at_termination(struct ndpi_detection_module_struct *ndpi_struct, char *buf) {
+
+
+}
+
+/* ****************************************************** */
+
static int ndpi_add_host_url_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
- char *value, int protocol_id,
+ char *_value, int protocol_id,
ndpi_protocol_category_t category,
- ndpi_protocol_breed_t breed)
-{
+ ndpi_protocol_breed_t breed) {
+ char *value = ndpi_strdup(_value);
+
+ if(!value) return(-1); else ndpi_free_memory_at_termination(ndpi_struct, value);
+
#ifdef DEBUG
NDPI_LOG_DEBUG2(ndpi_struct, "[NDPI] Adding [%s][%d]\n", value, protocol_id);
#endif
- return(ndpi_string_to_automa(ndpi_struct, &ndpi_struct->host_automa, value, protocol_id,
+ return(ndpi_string_to_automa(ndpi_struct,
+ &ndpi_struct->host_automa,
+ value,
+ protocol_id,
category, breed));
}