From 05fd71264a25efd6d29d82d94bb7ddc447251fc0 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 20 Jan 2016 13:03:49 +0100 Subject: [PATCH] FIX: Coverity Scan complains that the realloc might fail.. --- client/reveng/reveng.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/reveng/reveng.c b/client/reveng/reveng.c index 5cda62d1..d82353f8 100644 --- a/client/reveng/reveng.c +++ b/client/reveng/reveng.c @@ -473,9 +473,12 @@ chkres(int *resc, model_t **result, const poly_t divisor, const poly_t init, int pfree(&xor); 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"); - + return; + } + rptr = *result + *resc - 1; rptr->spoly = pclone(divisor); rptr->init = pclone(init); -- 2.39.5