diff options
author | Luca Deri <deri@ntop.org> | 2020-07-07 17:32:26 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-07-07 17:32:26 +0200 |
commit | f1dd8bc8c5254f2910c609e7aa56869c55bebe00 (patch) | |
tree | 6eccb952d53f64816e1cde2af5cd0fb8905424e7 | |
parent | 0c80e6ee3bed251e42c9eb3f9ddb4ce169061d1f (diff) |
Memory allocation fixes
-rw-r--r-- | example/ndpiReader.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index a3e35bd4f..11ec175b0 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -3136,7 +3136,7 @@ static void binUnitTest() { srand(time(NULL)); - assert((bins = (struct ndpi_bin*)malloc(sizeof(struct ndpi_bin)*num_bins)) != NULL); + assert((bins = (struct ndpi_bin*)ndpi_malloc(sizeof(struct ndpi_bin)*num_bins)) != NULL); for(i=0; i<num_bins; i++) { ndpi_init_bin(&bins[i], ndpi_bin_family8, num_points); @@ -3147,7 +3147,6 @@ static void binUnitTest() { ndpi_normalize_bin(&bins[i]); } - ndpi_cluster_bins(bins, num_bins, num_clusters, cluster_ids); for(j=0; j<num_clusters; j++) { @@ -3164,7 +3163,7 @@ static void binUnitTest() { for(i=0; i<num_bins; i++) ndpi_free_bin(&bins[i]); - free(bins); + ndpi_free(bins); } /* *********************************************** */ |