1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

ldb_tdb: Reduce memory consumption in list_intersect()

We will never have more results than is in either list or list2.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett 2017-08-22 11:17:56 +12:00
parent 97b026a73f
commit 3c6977b17c

View File

@ -885,7 +885,8 @@ static bool list_intersect(struct ldb_context *ldb,
return false;
}
list3->dn = talloc_array(list3, struct ldb_val, list->count);
list3->dn = talloc_array(list3, struct ldb_val,
MIN(list->count, list2->count));
if (!list3->dn) {
talloc_free(list3);
return false;