Fix int_array_concat() to bail out on realloc failure

The previous version could have ended up dereferencing a NULL pointer
if the reallocation call were to fail.
This commit is contained in:
Jouni Malinen 2009-11-02 19:14:17 +02:00
parent 72ffc08242
commit e6c0ebff68

View file

@ -132,6 +132,7 @@ static void int_array_concat(int **res, const int *a)
if (n == NULL) {
os_free(*res);
*res = NULL;
return;
}
for (i = 0; i <= alen; i++)
n[reslen + i] = a[i];