From: Douglas Bagnall Date: Tue, 5 Jul 2016 23:53:19 +0000 (+1200) Subject: repl_meta_data: free context on error in replmd_modify_la_delete() X-Git-Tag: tdb-1.3.10~388 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7b229a424cfe6a2bbe7b091c93a6f09b2132975;p=thirdparty%2Fsamba.git repl_meta_data: free context on error in replmd_modify_la_delete() Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index d952868917c..efd1932a9ec 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -2210,6 +2210,7 @@ static int replmd_modify_la_delete(struct ldb_module *module, invocation_id = samdb_ntds_invocation_id(ldb); if (!invocation_id) { + talloc_free(tmp_ctx); return LDB_ERR_OPERATIONS_ERROR; } @@ -2234,8 +2235,10 @@ static int replmd_modify_la_delete(struct ldb_module *module, ldb_asprintf_errstring(ldb, "Attribute %s doesn't exist for target GUID %s", el->name, GUID_buf_string(&p->guid, &buf)); if (ldb_attr_cmp(el->name, "member") == 0) { + talloc_free(tmp_ctx); return LDB_ERR_UNWILLING_TO_PERFORM; } else { + talloc_free(tmp_ctx); return LDB_ERR_NO_SUCH_ATTRIBUTE; } } @@ -2245,8 +2248,10 @@ static int replmd_modify_la_delete(struct ldb_module *module, ldb_asprintf_errstring(ldb, "Attribute %s already deleted for target GUID %s", el->name, GUID_buf_string(&p->guid, &buf)); if (ldb_attr_cmp(el->name, "member") == 0) { + talloc_free(tmp_ctx); return LDB_ERR_UNWILLING_TO_PERFORM; } else { + talloc_free(tmp_ctx); return LDB_ERR_NO_SUCH_ATTRIBUTE; } }