diff options
author | bapt <bapt@FreeBSD.org> | 2015-11-07 16:45:51 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-11-07 16:45:51 +0000 |
commit | 397e26d13592a3d550c9feac0ec9761af4bd62b0 (patch) | |
tree | 995a626ce0253ed854128182797b05aba389a557 /usr.bin/localedef | |
parent | 130223d5a3e6a0003a8953a6529a048d4cf987d7 (diff) | |
download | FreeBSD-src-397e26d13592a3d550c9feac0ec9761af4bd62b0.zip FreeBSD-src-397e26d13592a3d550c9feac0ec9761af4bd62b0.tar.gz |
Run memset only after having checked the return of malloc
Submitted by: pluknet
Diffstat (limited to 'usr.bin/localedef')
-rw-r--r-- | usr.bin/localedef/collate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/localedef/collate.c b/usr.bin/localedef/collate.c index 5a31a75..3216d21 100644 --- a/usr.bin/localedef/collate.c +++ b/usr.bin/localedef/collate.c @@ -1256,11 +1256,11 @@ dump_collate(void) */ RB_NUMNODES(collchar_t, collchars, &collchars, n); large = malloc(sizeof (collate_large_t) * n); - memset(large, 0, sizeof (collate_large_t) * n); if (large == NULL) { fprintf(stderr, "out of memory"); return; } + memset(large, 0, sizeof (collate_large_t) * n); i = 0; RB_FOREACH(cc, collchars, &collchars) { |