svn commit: r298371 - head/usr.bin/whereis

Baptiste Daroussin bapt at FreeBSD.org
Wed Apr 20 20:56:07 UTC 2016


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;


More information about the svn-src-head mailing list