From: Volker Lendecke Date: Wed, 28 Mar 2018 12:10:59 +0000 (-0500) Subject: dsdb: Fix CID 1433614 Dereference after null check X-Git-Tag: talloc-2.1.13~120 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bb7da3357388f7cf950455ca4f42cd7d43c3f02b;p=thirdparty%2Fsamba.git dsdb: Fix CID 1433614 Dereference after null check This whole routine assumes module!=NULL, both in the successful as well as in error cases. So checking for module!=NULL is confusing both the reader as well as Coverity. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 422ed369ff5..37e714d6e1b 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -1016,7 +1016,8 @@ int partition_del_trans(struct ldb_module *module) struct partition_private_data); for (i=0; data && data->partitions && data->partitions[i]; i++) { - if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) { + if (ldb_module_flags(ldb_module_get_ctx(module)) & + LDB_FLG_ENABLE_TRACING) { ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_del_trans() -> %s", ldb_dn_get_linearized(data->partitions[i]->ctrl->dn)); } @@ -1035,7 +1036,8 @@ int partition_del_trans(struct ldb_module *module) } data->in_transaction--; - if ((module && ldb_module_flags(ldb_module_get_ctx(module)) & LDB_FLG_ENABLE_TRACING)) { + if (ldb_module_flags(ldb_module_get_ctx(module)) & + LDB_FLG_ENABLE_TRACING) { ldb_debug(ldb_module_get_ctx(module), LDB_DEBUG_TRACE, "partition_del_trans() -> (metadata partition)"); } ret = ldb_next_del_trans(module);