From e308e59002539a989e87c72bdb462b9652e304b3 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 7 Jul 2020 17:07:20 +0200 Subject: fixed memory leak in ndpi_cluster_bins / binUnitTest Signed-off-by: Toni Uhlig --- src/lib/ndpi_analyze.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/ndpi_analyze.c b/src/lib/ndpi_analyze.c index 74adbb2c9..07fc09362 100644 --- a/src/lib/ndpi_analyze.c +++ b/src/lib/ndpi_analyze.c @@ -486,7 +486,7 @@ int ndpi_cluster_bins(struct ndpi_bin *bins, u_int16_t num_bins, if(num_clusters > num_bins) return(-1); - if((centroids = (struct ndpi_bin*)malloc(sizeof(struct ndpi_bin)*num_clusters)) == NULL) + if((centroids = (struct ndpi_bin*)ndpi_malloc(sizeof(struct ndpi_bin)*num_clusters)) == NULL) return(-2); else { for(i=0; i