mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-04 12:52:15 +00:00
Fix bad checking of the return of realloc(3)
Reported by: Coverity CID: 1007335 MFC after: 3 days
This commit is contained in:
parent
5f3dd91a8f
commit
c1eac826c2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298371
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user