Fix bad checking of the return of realloc(3)

Reported by:	Coverity
CID:		1007335
MFC after:	3 days
This commit is contained in:
Baptiste Daroussin 2016-04-20 20:56:06 +00:00
parent 5f3dd91a8f
commit c1eac826c2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298371

View File

@ -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;