summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2016-03-22 13:32:12 +1300
committerAndrew Bartlett <abartlet@samba.org>2016-03-22 08:00:31 +0100
commit7bd06613da4efa63a2c97260e018878aa50e15a5 (patch)
treedc6e7543d8c305902dab524b55d5e2c8b142a415 /lib
parent66c5082952b017f46248966488e55f5f68fecef7 (diff)
downloadsamba-7bd06613da4efa63a2c97260e018878aa50e15a5.tar.gz
ldb client controls: don't ignore failed memdup
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/common/ldb_controls.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ldb/common/ldb_controls.c b/lib/ldb/common/ldb_controls.c
index ba813ea04cf..da7381b3482 100644
--- a/lib/ldb/common/ldb_controls.c
+++ b/lib/ldb/common/ldb_controls.c
@@ -520,6 +520,10 @@ struct ldb_control *ldb_parse_control_from_string(struct ldb_context *ldb, TALLO
control->ctxid_len = len;
control->contextId = talloc_memdup(control, ctxid,
control->ctxid_len);
+ if (control->contextId == NULL) {
+ ldb_oom(ldb);
+ return NULL;
+ }
} else {
control->ctxid_len = 0;
control->contextId = NULL;
@@ -572,6 +576,10 @@ struct ldb_control *ldb_parse_control_from_string(struct ldb_context *ldb, TALLO
}
control->cookie_len = len;
control->cookie = (char *)talloc_memdup(control, cookie, control->cookie_len);
+ if (control->cookie == NULL) {
+ ldb_oom(ldb);
+ return NULL;
+ }
} else {
control->cookie = NULL;
control->cookie_len = 0;
@@ -625,6 +633,10 @@ struct ldb_control *ldb_parse_control_from_string(struct ldb_context *ldb, TALLO
}
control->cookie_len = len;
control->cookie = (char *)talloc_memdup(control, cookie, control->cookie_len);
+ if (control->cookie == NULL) {
+ ldb_oom(ldb);
+ return NULL;
+ }
} else {
control->cookie = NULL;
control->cookie_len = 0;