aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/ndpi_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index 153822988..e7172a589 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -316,6 +316,9 @@ void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_str,
name = ndpi_strdup(protoName);
+ if(ndpi_str->proto_defaults[protoId].protoName)
+ ndpi_free(ndpi_str->proto_defaults[protoId].protoName);
+
ndpi_str->proto_defaults[protoId].protoName = name,
ndpi_str->proto_defaults[protoId].protoCategory = protoCategory,
ndpi_str->proto_defaults[protoId].protoId = protoId,