FIX: Coverity Scan complains that the realloc might fail..

This commit is contained in:
iceman1001 2016-01-20 13:03:49 +01:00
commit 05fd71264a

View file

@ -473,8 +473,11 @@ chkres(int *resc, model_t **result, const poly_t divisor, const poly_t init, int
pfree(&xor); pfree(&xor);
if(aptr != eptr) return; if(aptr != eptr) return;
if(!(*result = realloc(*result, ++*resc * sizeof(model_t)))) *result = realloc(*result, ++*resc * sizeof(model_t));
if (!*result) {
uerror("cannot reallocate result array"); uerror("cannot reallocate result array");
return;
}
rptr = *result + *resc - 1; rptr = *result + *resc - 1;
rptr->spoly = pclone(divisor); rptr->spoly = pclone(divisor);