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;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to