ndpi: check ndpi_finalize_initialization result

It returns -1 when the dissectors could not be initialized, in which
case the module was used anyway. Free it and fail module creation
instead; the callers already handle that.

Ticket: 8077
pull/16354/head
TripleA150 1 month ago
parent 85b84f124c
commit a52a290542

@ -164,7 +164,10 @@ static struct ndpi_detection_module_struct *NdpiModuleNew(bool shared_caches)
}
}
ndpi_finalize_initialization(ndpi);
if (ndpi_finalize_initialization(ndpi) != 0) {
ndpi_exit_detection_module(ndpi);
return NULL;
}
return ndpi;
}

Loading…
Cancel
Save