aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremanuele-f <faranda@ntop.org>2019-11-19 11:41:27 +0100
committeremanuele-f <faranda@ntop.org>2019-11-19 11:42:04 +0100
commit0b819badd2156fa2d959eabb82d52b0082ddc53b (patch)
tree840ff99e2a3c894e0c7bcff8cdd743affb2f7321
parent3754e6dd12b7f91fbb74930ed2a64acf8f6f87ea (diff)
Possible leak fix
-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,