From 88190083e257363993bf3a8a03c4b6f95c7faf9d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 31 Oct 2022 13:16:25 +0100 Subject: [PATCH] lib/replace: fix memory leak in snprintf replacements BUG: https://bugzilla.samba.org/show_bug.cgi?id=15230 Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Wed Nov 9 11:18:02 UTC 2022 on sn-devel-184 (cherry picked from commit 76adda9d2fea9f93f4cf97536db5c0be6deeb98c) --- lib/replace/snprintf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/replace/snprintf.c b/lib/replace/snprintf.c index 6e4424b0b318..de814af41641 100644 --- a/lib/replace/snprintf.c +++ b/lib/replace/snprintf.c @@ -751,6 +751,8 @@ done: while (chunks) { cnk = chunks->next; + if (chunks->min_star) free(chunks->min_star); + if (chunks->max_star) free(chunks->max_star); free(chunks); chunks = cnk; } -- 2.34.1