diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 6a65726c181..6b0fbe728bc 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -1185,7 +1185,10 @@ int partition_end_trans(struct ldb_module *module) * partition_start_trans. See comment in that function for detail. */ if (data && data->partitions) { - for (i=0; data->partitions[i]; i++);; + /* Just counting the partitions */ + for (i=0; data->partitions[i]; i++) {} + + /* now walk them backwards */ for (i--; i>=0; i--) { struct dsdb_partition *p = data->partitions[i]; if (trace) { @@ -1241,7 +1244,10 @@ int partition_del_trans(struct ldb_module *module) * partition_start_trans. See comment in that function for detail. */ if (data->partitions) { - for (i=0; data->partitions[i]; i++);; + /* Just counting the partitions */ + for (i=0; data->partitions[i]; i++) {} + + /* now walk them backwards */ for (i--; i>=0; i--) { struct dsdb_partition *p = data->partitions[i]; if (trace) { @@ -1595,7 +1601,10 @@ int partition_read_unlock(struct ldb_module *module) * partition_start_trans. See comment in that function for detail. */ if (data && data->partitions) { - for (i=0; data->partitions[i]; i++);; + /* Just counting the partitions */ + for (i=0; data->partitions[i]; i++) {} + + /* now walk them backwards */ for (i--; i>=0; i--) { struct dsdb_partition *p = data->partitions[i]; if (trace) {