diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2019-01-09 17:55:38 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-02-13 04:15:14 +0100 |
commit | a086a6457b421c36562275a425ce2bbd32336f8f (patch) | |
tree | b4970321b2468662f8b0f4ffbcb3a86ad19b2ed9 /source4 | |
parent | 5b0a9818ffd88d495ffbd7387d51d30d5594133d (diff) | |
download | samba-a086a6457b421c36562275a425ce2bbd32336f8f.tar.gz |
dsdb: linked attrs: check a talloc_new()
Also we can defer it past a thing that doesn't need or check for it.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/linked_attributes.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c index 2568d4d1790..816968584b5 100644 --- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c +++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c @@ -695,7 +695,7 @@ static int linked_attributes_fix_links(struct ldb_module *module, struct ldb_request *parent) { unsigned int i, j; - TALLOC_CTX *tmp_ctx = talloc_new(module); + TALLOC_CTX *tmp_ctx = NULL; struct ldb_context *ldb = ldb_module_get_ctx(module); const struct dsdb_attribute *target; const char *attrs[2]; @@ -707,6 +707,11 @@ static int linked_attributes_fix_links(struct ldb_module *module, return LDB_SUCCESS; } + tmp_ctx = talloc_new(module); + if (tmp_ctx == NULL) { + return LDB_ERR_OPERATIONS_ERROR; + } + attrs[0] = target->lDAPDisplayName; attrs[1] = NULL; |