From 7d843f4d17d3f5040e0b39a3a265404e85e4e3c7 Mon Sep 17 00:00:00 2001 From: Nardi Ivan Date: Sun, 26 Jul 2020 21:11:34 +0200 Subject: Minor fixes Fix a memory leak and an issue (re)-introduced in configure script --- configure.seed | 4 ++-- example/ndpiReader.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/configure.seed b/configure.seed index 1c520f9ab..b344064cd 100644 --- a/configure.seed +++ b/configure.seed @@ -9,8 +9,8 @@ AC_ARG_ENABLE(fuzztargets, AS_HELP_STRING([--enable-fuzztargets], [Enable fuzz t AM_CONDITIONAL([BUILD_FUZZTARGETS], [test "x$enable_fuzztargets" = "xyes"]) AS_IF([test "${with_sanitizer+set}" = set],[ - CFLAGS+="${CFLAGS} -g3 -O0 -Wno-unused-value -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer" - LDFLAGS+="${LDFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak" + CFLAGS="${CFLAGS} -g3 -O0 -Wno-unused-value -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer" + LDFLAGS="${LDFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak" ]) LT_INIT diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 54d5abd4b..b0d1a9122 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -2529,11 +2529,12 @@ static void printFlowsStats() { ndpi_free_bin(¢roids[i]); ndpi_free(centroids); - - ndpi_free(bins); - ndpi_free(cluster_ids); } } + if(bins) + ndpi_free(bins); + if(cluster_ids) + ndpi_free(cluster_ids); #endif } -- cgit v1.2.3