The branch, master has been updated via affb734a256 tdbtorture: Fix CID 1034816: proper calloc usage from d4d231dc50f nsswitch/libwbclient: Fix CID #1034862 Resource leak
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit affb734a2568a342e443872ae6c789ef03f5faa6 Author: Shachar Sharon <ssha...@redhat.com> Date: Tue Aug 19 12:18:28 2025 +0300 tdbtorture: Fix CID 1034816: proper calloc usage Standard signature is 'calloc(n_elems, elem_size)', where element size (in particular, when using 'sizeof') comes as 2nd arg. The actual allocation size does not care for ordering but swapping the order confuses static-analysis tools like Coverity, as well as naive readers. Signed-off-by: Shachar Sharon <ssha...@redhat.com> Reviewed-by: Vinit Agnihotri <vagni...@redhat.com> Reviewed-by: Shweta Sodani <ssod...@redhat.com> Reviewed-by: Rabinarayan Panigrahi <rapan...@redhat.com> Reviewed-by: Anoop C S <anoo...@samba.org> Reviewed-by: Guenther Deschner <g...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> Autobuild-User(master): Günther Deschner <g...@samba.org> Autobuild-Date(master): Tue Aug 19 18:08:02 UTC 2025 on atb-devel-224 ----------------------------------------------------------------------- Summary of changes: lib/tdb/tools/tdbtorture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/tdb/tools/tdbtorture.c b/lib/tdb/tools/tdbtorture.c index 1063f14f4cc..14dc5e7a8d1 100644 --- a/lib/tdb/tools/tdbtorture.c +++ b/lib/tdb/tools/tdbtorture.c @@ -374,12 +374,12 @@ int main(int argc, char * const *argv) goto done; } - pids = (pid_t *)calloc(sizeof(pid_t), num_procs); + pids = (pid_t *)calloc(num_procs, sizeof(pid_t)); if (pids == NULL) { perror("Unable to allocate memory for pids"); exit(1); } - done = (int *)calloc(sizeof(int), num_procs); + done = (int *)calloc(num_procs, sizeof(int)); if (done == NULL) { perror("Unable to allocate memory for done"); exit(1); -- Samba Shared Repository