From: Volker Lendecke Date: Tue, 12 Jun 2018 19:31:15 +0000 (+0200) Subject: dsdb: Fix CID 1435968 Dereference before null check X-Git-Tag: tevent-0.9.37~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15fa8f9f24c69832cc4f309e59ee6292a7c33938;p=thirdparty%2Fsamba.git dsdb: Fix CID 1435968 Dereference before null check Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Jun 13 13:40:56 CEST 2018 on sn-devel-144 --- diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 098fdb0916e..49bdeb04fa5 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -547,7 +547,6 @@ static int partition_copy_all_callback_handler( struct ldb_reply *ares) { struct partition_copy_context *ac = NULL; - int error = ares->error; ac = talloc_get_type( req->context, @@ -574,8 +573,8 @@ static int partition_copy_all_callback_handler( ac->request, ares->referral); - case LDB_REPLY_DONE: - error = ares->error; + case LDB_REPLY_DONE: { + int error = ares->error; if (error == LDB_SUCCESS) { error = partition_copy_all_callback_action( ac->module, @@ -588,6 +587,7 @@ static int partition_copy_all_callback_handler( ares->controls, ares->response, error); + } default: /* Can't happen */