From: Joseph Sutton Date: Thu, 5 Oct 2023 22:15:38 +0000 (+1300) Subject: s4:dns_server: Merge similar code paths X-Git-Tag: tevent-0.16.0~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3b1aa6359deaa6e2f97f7e435024c1fe548fe58;p=thirdparty%2Fsamba.git s4:dns_server: Merge similar code paths Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dns_server/dns_update.c b/source4/dns_server/dns_update.c index 19eaaaf2d88..13f16f244f8 100644 --- a/source4/dns_server/dns_update.c +++ b/source4/dns_server/dns_update.c @@ -751,20 +751,12 @@ static WERROR handle_updates(struct dns_server *dns, W_ERROR_NOT_OK_GOTO(werror, failed); } - ldb_transaction_commit(dns->samdb); - TALLOC_FREE(tmp_ctx); - - if (tkey != NULL) { - ldb_set_opaque( - dns->samdb, - DSDB_SESSION_INFO, - system_session(dns->task->lp_ctx)); - } - - return WERR_OK; - failed: - ldb_transaction_cancel(dns->samdb); + if (W_ERROR_IS_OK(werror)) { + ldb_transaction_commit(dns->samdb); + } else { + ldb_transaction_cancel(dns->samdb); + } if (tkey != NULL) { ldb_set_opaque(