From: Stefan Metzmacher Date: Mon, 31 Oct 2022 12:16:25 +0000 (+0100) Subject: lib/replace: fix memory leak in snprintf replacements X-Git-Tag: talloc-2.4.0~564 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76adda9d2fea9f93f4cf97536db5c0be6deeb98c;p=thirdparty%2Fsamba.git 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 --- diff --git a/lib/replace/snprintf.c b/lib/replace/snprintf.c index 6e4424b0b31..de814af4164 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; }