From: Douglas Bagnall Date: Tue, 30 Jul 2024 21:20:50 +0000 (+1200) Subject: ldb:kv_index: help static analysers to not worry (CID 1615192) X-Git-Tag: ldb-2.8.2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a15cbb15da64a0ba5c0cfde5ab736712083ea24;p=thirdparty%2Fsamba.git ldb:kv_index: help static analysers to not worry (CID 1615192) The point of this realloc is that we are not using this array, but keeping it around to remain a node the talloc tree. We'd prefer to reduce it to nothing. Coverity rightly spotted that it was reallocing an array of `struct ldb_val` to an array of `struct ldb_val *`, which has a different size and all. But it doesn't matter in this case, because we will never use it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15590 Signed-off-by: Douglas Bagnall Reviewed-by: Jennifer Sutton (cherry picked from commit e2a74963fb89f5409c236a0fbe4cd070e1a75a43) Autobuild-User(v4-19-test): Jule Anger Autobuild-Date(v4-19-test): Mon Oct 7 15:22:36 UTC 2024 on atb-devel-224 --- diff --git a/lib/ldb/ldb_key_value/ldb_kv_index.c b/lib/ldb/ldb_key_value/ldb_kv_index.c index f602f588117..902fb9b69f2 100644 --- a/lib/ldb/ldb_key_value/ldb_kv_index.c +++ b/lib/ldb/ldb_key_value/ldb_kv_index.c @@ -3924,7 +3924,7 @@ static int ldb_kv_sub_transaction_traverse( * node. */ talloc_realloc(index_in_top_level, - index_in_top_level->dn, struct ldb_val *, 1); + index_in_top_level->dn, struct ldb_val, 1); index_in_top_level->dn = talloc_steal(index_in_top_level, index_in_subtransaction->dn);