diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-08-26 14:50:15 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-08-27 01:16:33 +0000 |
commit | 1521a22f4366c86ec955cb9d32b7a758315d8ce0 (patch) | |
tree | 77353313368fecd19c70d884dcda14fe4d7df460 /lib | |
parent | 2117789c35fbf6d0ed02f391f17593e11727ec3e (diff) | |
download | samba-1521a22f4366c86ec955cb9d32b7a758315d8ce0.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
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); } /* |