aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index a6d32a6ff..547550c45 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -538,6 +538,12 @@ void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_str,
}
name = ndpi_strdup(protoName);
+ if(!name) {
+#ifdef DEBUG
+ NDPI_LOG_ERR(ndpi_str, "[NDPI] %s/protoId=%d: mem allocation error\n", protoName, protoId);
+#endif
+ return;
+ }
if(ndpi_str->proto_defaults[protoId].protoName)
ndpi_free(ndpi_str->proto_defaults[protoId].protoName);