git.samba.org
/
garming
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97b026a
)
ldb_tdb: Reduce memory consumption in list_intersect()
author
Andrew Bartlett
<abartlet@samba.org>
Mon, 21 Aug 2017 23:17:56 +0000
(11:17 +1200)
committer
Andrew Bartlett
<abartlet@samba.org>
Fri, 22 Sep 2017 19:20:23 +0000
(21:20 +0200)
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>
lib/ldb/ldb_tdb/ldb_index.c
patch
|
blob
|
history
diff --git
a/lib/ldb/ldb_tdb/ldb_index.c
b/lib/ldb/ldb_tdb/ldb_index.c
index 16897209b03a157cbd79a12d6d199bfa0ac8c06c..49153475b5e9316e0894f17d6b5d4d70fbb210a4 100644
(file)
--- a/
lib/ldb/ldb_tdb/ldb_index.c
+++ b/
lib/ldb/ldb_tdb/ldb_index.c
@@
-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;