replmd_modify_delete: check talloc_new()
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 30 Jun 2016 03:43:33 +0000 (15:43 +1200)
committerGarming Sam <garming@samba.org>
Fri, 15 Jul 2016 08:01:28 +0000 (10:01 +0200)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index 3f76908f8e3b3cf282009bb316c213c7363047b3..d952868917cec9291f78910a88be097392f796fa 100644 (file)
@@ -2173,7 +2173,7 @@ static int replmd_modify_la_delete(struct ldb_module *module,
 {
        unsigned int i;
        struct parsed_dn *dns, *old_dns;
-       TALLOC_CTX *tmp_ctx = talloc_new(msg);
+       TALLOC_CTX *tmp_ctx = NULL;
        int ret;
        const struct GUID *invocation_id;
        struct ldb_context *ldb = ldb_module_get_ctx(module);
@@ -2191,6 +2191,11 @@ static int replmd_modify_la_delete(struct ldb_module *module,
                return LDB_ERR_NO_SUCH_ATTRIBUTE;
        }
 
+       tmp_ctx = talloc_new(msg);
+       if (tmp_ctx == NULL) {
+               return LDB_ERR_OPERATIONS_ERROR;
+       }
+
        ret = get_parsed_dns(module, tmp_ctx, el, &dns, schema_attr->syntax->ldap_oid, parent);
        if (ret != LDB_SUCCESS) {
                talloc_free(tmp_ctx);