1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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 <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <josutton@catalyst.net.nz>
(cherry picked from commit e2a74963fb)
This commit is contained in:
Douglas Bagnall 2024-07-31 09:20:50 +12:00 committed by Jule Anger
parent 76e1024f4c
commit 0a99463b3e

View File

@ -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);