Date: Sat, 7 Nov 2015 16:45:51 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290500 - head/usr.bin/localedef Message-ID: <201511071645.tA7Gjp9O006119@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Sat Nov 7 16:45:51 2015 New Revision: 290500 URL: https://svnweb.freebsd.org/changeset/base/290500 Log: Run memset only after having checked the return of malloc Submitted by: pluknet Modified: head/usr.bin/localedef/collate.c Modified: head/usr.bin/localedef/collate.c ============================================================================== --- head/usr.bin/localedef/collate.c Sat Nov 7 16:22:29 2015 (r290499) +++ head/usr.bin/localedef/collate.c Sat Nov 7 16:45:51 2015 (r290500) @@ -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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511071645.tA7Gjp9O006119>