From: Garming Sam Date: Thu, 2 May 2019 05:11:57 +0000 (+1200) Subject: CID 1363287: Resource leak using str_list_append X-Git-Tag: tdb-1.4.1~164 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a4973270423203d9881cdbf2d24fadd02c3228c0;p=thirdparty%2Fsamba.git CID 1363287: Resource leak using str_list_append Signed-off-by: Garming Sam Reviewed-by: Gary Lockyer --- diff --git a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c index 95967c33e12..a522c363fae 100644 --- a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c +++ b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c @@ -123,6 +123,10 @@ static int prepare_modules_line(struct ldb_context *ldb, } mod_list_string = str_list_join(tmp_ctx, backend_full_list, ','); + + /* str_list_append allocates on NULL */ + talloc_free(backend_full_list); + if (!mod_list_string) { talloc_free(tmp_ctx); return ldb_oom(ldb);