diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-08-26 14:50:15 +1200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2019-09-04 08:31:24 +0000 |
commit | 61a039cc21d845bb4b984929d878dd8cf68839fe (patch) | |
tree | ed6b39eaec062f84e0945a719c2b8359a17a0e07 /lib | |
parent | 11427be15ed6701fb2a15830846b57fe5e62fb42 (diff) | |
download | samba-61a039cc21d845bb4b984929d878dd8cf68839fe.tar.gz |
ldb: Call TALLOC_FREE(filtered_msg->elements) on ldb_filter_attrs() failure
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 27 01:16:33 UTC 2019 on sn-devel-184
(cherry picked from commit 1521a22f4366c86ec955cb9d32b7a758315d8ce0)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ldb/common/ldb_pack.c | 1 | ||||
-rw-r--r-- | lib/ldb/tests/ldb_filter_attrs_test.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/ldb/common/ldb_pack.c b/lib/ldb/common/ldb_pack.c index b5e1fbbc4ff..e7dd364008a 100644 --- a/lib/ldb/common/ldb_pack.c +++ b/lib/ldb/common/ldb_pack.c @@ -1256,5 +1256,6 @@ int ldb_filter_attrs(struct ldb_context *ldb, return 0; failed: + TALLOC_FREE(filtered_msg->elements); return -1; } diff --git a/lib/ldb/tests/ldb_filter_attrs_test.c b/lib/ldb/tests/ldb_filter_attrs_test.c index d04775879ac..7d555e0da2e 100644 --- a/lib/ldb/tests/ldb_filter_attrs_test.c +++ b/lib/ldb/tests/ldb_filter_attrs_test.c @@ -384,6 +384,7 @@ static void test_filter_attrs_two_dup_attr_matched_one_attr(void **state) /* This should fail the pidgenhole test */ assert_int_equal(ret, -1); + assert_null(filtered_msg->elements); } /* @@ -772,6 +773,7 @@ static void test_filter_attrs_one_attr_matched_star_no_dn(void **state) attrs, filtered_msg); assert_int_equal(ret, -1); + assert_null(filtered_msg->elements); } /* |