diff options
author | emanuele-f <faranda@ntop.org> | 2019-11-19 11:41:27 +0100 |
---|---|---|
committer | emanuele-f <faranda@ntop.org> | 2019-11-19 11:42:04 +0100 |
commit | 0b819badd2156fa2d959eabb82d52b0082ddc53b (patch) | |
tree | 840ff99e2a3c894e0c7bcff8cdd743affb2f7321 | |
parent | 3754e6dd12b7f91fbb74930ed2a64acf8f6f87ea (diff) |
Possible leak fix
-rw-r--r-- | src/lib/ndpi_main.c | 3 |
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, |