From 536b5207500cb7a7139c315bcd9bb85dd2276675 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Thu, 29 Aug 2019 15:47:34 +0200 Subject: Added stub for ndpi_free_memory_at_termination() (TODO) --- src/lib/ndpi_main.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/lib/ndpi_main.c') 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)); } -- cgit v1.2.3