diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-14 15:35:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-14 15:35:41 +0000 |
commit | 931d39ec0ef8235f9cbfb8d72d177594486ff276 (patch) | |
tree | 6e7dac76ccc8df770d4bb6f83775473381073b8c /usr.bin/mklocale | |
parent | 897fd7cf543322f9234b4d5b0ebc991dac4060a4 (diff) |
obvious use of reallocarray()
Diffstat (limited to 'usr.bin/mklocale')
-rw-r--r-- | usr.bin/mklocale/yacc.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y index e3bc5c47f34..430256ffe38 100644 --- a/usr.bin/mklocale/yacc.y +++ b/usr.bin/mklocale/yacc.y @@ -1,4 +1,4 @@ -/* $OpenBSD: yacc.y,v 1.5 2012/12/05 23:20:25 deraadt Exp $ */ +/* $OpenBSD: yacc.y,v 1.6 2014/10/14 15:35:40 deraadt Exp $ */ /* $NetBSD: yacc.y,v 1.24 2004/01/05 23:23:36 jmmv Exp $ */ %{ @@ -311,7 +311,7 @@ xmalloc(size_t sz) u_int32_t * xlalloc(size_t sz) { - u_int32_t *r = (u_int32_t *)malloc(sz * sizeof(u_int32_t)); + u_int32_t *r = (u_int32_t *)reallocarray(NULL, sz, sizeof(u_int32_t)); if (!r) { perror("xlalloc"); abort(); @@ -322,7 +322,7 @@ xlalloc(size_t sz) u_int32_t * xrelalloc(u_int32_t *old, size_t sz) { - u_int32_t *r = (u_int32_t *)realloc(old, sz * sizeof(u_int32_t)); + u_int32_t *r = (u_int32_t *)reallocarray(old, sz, sizeof(u_int32_t)); if (!r) { perror("xrelalloc"); abort(); |