From 890dcf91d9f1e8482dd9547823d77ec9c35d2662 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Fri, 11 Aug 2023 23:51:16 +0200 Subject: [PATCH] Minor initialization fixes --- src/lib/ndpi_filter.c | 3 +++ src/lib/third_party/include/binaryfusefilter.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/ndpi_filter.c b/src/lib/ndpi_filter.c index 8726946295c..989eb9317e1 100644 --- a/src/lib/ndpi_filter.c +++ b/src/lib/ndpi_filter.c @@ -35,6 +35,9 @@ #include "ndpi_includes.h" #include "ndpi_encryption.h" +#define malloc ndpi_malloc +#define free ndpi_free + #include "third_party/include/binaryfusefilter.h" /* ******************************************* */ diff --git a/src/lib/third_party/include/binaryfusefilter.h b/src/lib/third_party/include/binaryfusefilter.h index a6e4c4adb3e..4835f92eae1 100644 --- a/src/lib/third_party/include/binaryfusefilter.h +++ b/src/lib/third_party/include/binaryfusefilter.h @@ -227,7 +227,7 @@ static inline bool binary_fuse8_allocate(uint32_t size, filter->ArrayLength = (filter->SegmentCount + arity - 1) * filter->SegmentLength; filter->SegmentCountLength = filter->SegmentCount * filter->SegmentLength; - filter->Fingerprints = (uint8_t*)malloc(filter->ArrayLength); + filter->Fingerprints = (uint8_t*)calloc(1,filter->ArrayLength); return filter->Fingerprints != NULL; }