]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/reveng/reveng.c
CHG: changed output for the "hf mf nested" to show KEY: A or B instead of 0/1
[proxmark3-svn] / client / reveng / reveng.c
index 3c6da126ab136b24f836dc983db1c07276bfd72e..5cda62d16d980ffce36915e8d86c2900d442d9ef 100644 (file)
@@ -141,8 +141,10 @@ reveng(const model_t *guess, const poly_t qpoly, int rflags, int args, const pol
                engini(&resc, &result, guess->spoly, guess->flags, args, argpolys);
 
 requit:
                engini(&resc, &result, guess->spoly, guess->flags, args, argpolys);
 
 requit:
-       if(!(result = realloc(result, ++resc * sizeof(model_t))))
+       if(!(result = realloc(result, ++resc * sizeof(model_t)))) {
                uerror("cannot reallocate result array");
                uerror("cannot reallocate result array");
+               return NULL;
+       }
        rptr = result + resc - 1;
        rptr->spoly  = pzero;
        rptr->init   = pzero;
        rptr = result + resc - 1;
        rptr->spoly  = pzero;
        rptr->init   = pzero;
@@ -257,6 +259,7 @@ engini(int *resc, model_t **result, const poly_t divisor, int flags, int args, c
                palloc(&apoly, dlen);
                calini(resc, result, divisor, flags, apoly, args, argpolys);
                pfree(&apoly);
                palloc(&apoly, dlen);
                calini(resc, result, divisor, flags, apoly, args, argpolys);
                pfree(&apoly);
+               free(mat);
                return;
        }
 
                return;
        }
 
Impressum, Datenschutz