Date: Wed, 20 Apr 2016 20:56:06 +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: r298371 - head/usr.bin/whereis Message-ID: <201604202056.u3KKu6xQ084592@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Wed Apr 20 20:56:06 2016 New Revision: 298371 URL: https://svnweb.freebsd.org/changeset/base/298371 Log: Fix bad checking of the return of realloc(3) Reported by: Coverity CID: 1007335 MFC after: 3 days Modified: head/usr.bin/whereis/whereis.c Modified: head/usr.bin/whereis/whereis.c ============================================================================== --- head/usr.bin/whereis/whereis.c Wed Apr 20 20:55:58 2016 (r298370) +++ head/usr.bin/whereis/whereis.c Wed Apr 20 20:56:06 2016 (r298371) @@ -207,7 +207,7 @@ decolonify(char *s, ccharp **cppp, int * *cp = '\0'; if (strlen(s) && !contains(*cppp, s)) { *cppp = realloc(*cppp, (*ip + 2) * sizeof(char *)); - if (cppp == NULL) + if (*cppp == NULL) abort(); (*cppp)[*ip] = s; (*cppp)[*ip + 1] = NULL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604202056.u3KKu6xQ084592>