]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
FIX: resource leak, forgot a free
authoriceman1001 <iceman@iuse.se>
Thu, 18 Feb 2016 19:39:41 +0000 (20:39 +0100)
committericeman1001 <iceman@iuse.se>
Thu, 18 Feb 2016 19:39:41 +0000 (20:39 +0100)
client/cmdhflegic.c

index 361efdc98a78ae47b07a0ee2953e42da2c20a3a6..7b58567fe10d6b503bb65c24eedefa7d9524d0ba 100644 (file)
@@ -430,7 +430,10 @@ int CmdLegicCalcCrc8(const char *Cmd){
        uint8_t *data = malloc(len+1);
        if ( data == NULL ) return 1;
                
-       if (param_gethex(Cmd, 0, data, len )) return usage_legic_calccrc8(); 
+       if (param_gethex(Cmd, 0, data, len )) {
+               free(data);
+               return usage_legic_calccrc8();  
+       }
        
        uint32_t checksum =  CRC8Legic(data, len/2);    
        PrintAndLog("Bytes: %s || CRC8: %X", sprint_hex(data, len/2), checksum );
Impressum, Datenschutz