From: Vinit Agnihotri Date: Tue, 12 Aug 2025 06:02:00 +0000 (+0530) Subject: lib: Fix memory leak CID#1469247 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b5cc7d37f11347a606a4a9fe7f44ae43193318d;p=thirdparty%2Fsamba.git lib: Fix memory leak CID#1469247 pointer 'p' gets duplicated in file_lines_parse(), but not free'd before returning. Signed-off-by: Vinit Agnihotri Reviewed-by: Anoop C S Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Fri Aug 15 08:53:53 UTC 2025 on atb-devel-224 --- diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index 5d6afc3c0b1..21a6559fc43 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -178,11 +178,14 @@ char **file_lines_ploadv(TALLOC_CTX *mem_ctx, { char *p = NULL; size_t size; + char **ret = NULL; p = file_ploadv(argl, &size); if (!p) { return NULL; } - return file_lines_parse(p, size, numlines, mem_ctx); + ret = file_lines_parse(p, size, numlines, mem_ctx); + TALLOC_FREE(p); + return ret; }