From c1eac826c2c660373df78f48d0233725a29a9305 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 20 Apr 2016 20:56:06 +0000 Subject: [PATCH] Fix bad checking of the return of realloc(3) Reported by: Coverity CID: 1007335 MFC after: 3 days --- usr.bin/whereis/whereis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/whereis/whereis.c b/usr.bin/whereis/whereis.c index f5d8b0f05e6f..6864e7b71e59 100644 --- a/usr.bin/whereis/whereis.c +++ b/usr.bin/whereis/whereis.c @@ -207,7 +207,7 @@ decolonify(char *s, ccharp **cppp, int *ip) *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;