]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
FIX: Coverity Scan complains that the realloc might fail..
authoriceman1001 <iceman@iuse.se>
Wed, 20 Jan 2016 12:03:49 +0000 (13:03 +0100)
committericeman1001 <iceman@iuse.se>
Wed, 20 Jan 2016 12:03:49 +0000 (13:03 +0100)
client/reveng/reveng.c

index 5cda62d16d980ffce36915e8d86c2900d442d9ef..d82353f8ad0d4046def9f7b0c22c5f12b5367373 100644 (file)
@@ -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);
Impressum, Datenschutz