Date: Sat, 30 Nov 2024 16:51:37 GMT From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: d38bcd8919d6 - stable/13 - libgeom: Consistently use item count as the first argument to calloc Message-ID: <202411301651.4AUGpb8B050434@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d38bcd8919d6312862e891fa2a58c8865ce55afe commit d38bcd8919d6312862e891fa2a58c8865ce55afe Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-07-19 17:02:05 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-11-29 19:25:49 +0000 libgeom: Consistently use item count as the first argument to calloc Reported by: GCC 14 -Wcalloc-transposed-args Reviewed by: rlibby, imp, emaste Differential Revision: https://reviews.freebsd.org/D46006 (cherry picked from commit bf3b889a5be141f3abadcfc5a1d1cbdc50273d72) --- lib/libgeom/geom_xml2tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libgeom/geom_xml2tree.c b/lib/libgeom/geom_xml2tree.c index 49cbb0385770..2d2c43e29e77 100644 --- a/lib/libgeom/geom_xml2tree.c +++ b/lib/libgeom/geom_xml2tree.c @@ -407,7 +407,7 @@ geom_xml2tree(struct gmesh *gmp, char *p) free(mt); return (error); } - gmp->lg_ident = calloc(sizeof *gmp->lg_ident, mt->nident + 1); + gmp->lg_ident = calloc(mt->nident + 1, sizeof(*gmp->lg_ident)); free(mt); if (gmp->lg_ident == NULL) return (ENOMEM);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202411301651.4AUGpb8B050434>