]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CID 1363287: Resource leak using str_list_append
authorGarming Sam <garming@catalyst.net.nz>
Thu, 2 May 2019 05:11:57 +0000 (17:11 +1200)
committerGary Lockyer <gary@samba.org>
Tue, 7 May 2019 23:22:22 +0000 (23:22 +0000)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/samba_dsdb.c

index 95967c33e126719e6eb3eb9f693acde3d9ce8c63..a522c363fae1284e5581cff015b6079b53f9f202 100644 (file)
@@ -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);