]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/nonce2key/crapto1.c
FIX: Coverity scan fixes, hard to keep track of stringlengths while reading and...
[proxmark3-svn] / client / nonce2key / crapto1.c
index f005a9e320e1a113e3d8f89a0be9c0f44e2348eb..626823f8022c43bc001f7d7b0c290c4a3aaa6208 100644 (file)
@@ -486,12 +486,11 @@ struct Crypto1State* lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8]
        odd = lfsr_prefix_ks(ks, 1);\r
        even = lfsr_prefix_ks(ks, 0);\r
 \r
-       s = statelist = malloc((sizeof *statelist) << 21);\r
+       s = statelist = malloc((sizeof *statelist) << 20);\r
        if(!s || !odd || !even) {\r
                free(statelist);\r
-               free(odd);\r
-               free(even);\r
-               return 0;\r
+               statelist = 0;\r
+                goto out;\r
        }\r
 \r
        for(o = odd; *o + 1; ++o)\r
@@ -503,8 +502,8 @@ struct Crypto1State* lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8]
                        }\r
 \r
        s->odd = s->even = 0;\r
-\r
+out:\r
        free(odd);\r
        free(even);\r
        return statelist;\r
-}
\ No newline at end of file
+}\r
Impressum, Datenschutz