summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/wrepl_server/wrepl_apply_records.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/wrepl_server/wrepl_apply_records.c b/source4/wrepl_server/wrepl_apply_records.c
index 033657987e..a16817e6ff 100644
--- a/source4/wrepl_server/wrepl_apply_records.c
+++ b/source4/wrepl_server/wrepl_apply_records.c
@@ -1012,11 +1012,14 @@ static void r_do_challenge_handler(struct irpc_request *ireq)
}
if (!old_is_subset) {
- r_do_late_release_demand(state);
+ status = r_do_late_release_demand(state);
/*
- * don't free state here, because we pass it down,
+ * only free state on error, because we pass it down,
* and r_do_late_release_demand() will free it
*/
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(state);
+ }
return;
}