mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
use after free fix
This commit is contained in:
parent
b12799ea5f
commit
10bb086ffd
1 changed files with 4 additions and 1 deletions
|
@ -2351,7 +2351,6 @@ int loadFileBinaryKey(const char *preferredName, const char *suffix, void **keya
|
||||||
free(path);
|
free(path);
|
||||||
return PM3_EFILE;
|
return PM3_EFILE;
|
||||||
}
|
}
|
||||||
free(path);
|
|
||||||
|
|
||||||
// get filesize in order to malloc memory
|
// get filesize in order to malloc memory
|
||||||
fseek(f, 0, SEEK_END);
|
fseek(f, 0, SEEK_END);
|
||||||
|
@ -2361,6 +2360,7 @@ int loadFileBinaryKey(const char *preferredName, const char *suffix, void **keya
|
||||||
if (fsize <= 0) {
|
if (fsize <= 0) {
|
||||||
PrintAndLogEx(FAILED, "error, when getting filesize");
|
PrintAndLogEx(FAILED, "error, when getting filesize");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
free(path);
|
||||||
return PM3_EFILE;
|
return PM3_EFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2371,6 +2371,7 @@ int loadFileBinaryKey(const char *preferredName, const char *suffix, void **keya
|
||||||
if (*keya == NULL) {
|
if (*keya == NULL) {
|
||||||
PrintAndLogEx(FAILED, "error, cannot allocate memory");
|
PrintAndLogEx(FAILED, "error, cannot allocate memory");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
free(path);
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2381,6 +2382,7 @@ int loadFileBinaryKey(const char *preferredName, const char *suffix, void **keya
|
||||||
PrintAndLogEx(FAILED, "error, cannot allocate memory");
|
PrintAndLogEx(FAILED, "error, cannot allocate memory");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
free(*keya);
|
free(*keya);
|
||||||
|
free(path);
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2388,6 +2390,7 @@ int loadFileBinaryKey(const char *preferredName, const char *suffix, void **keya
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "loaded binary key file `" _YELLOW_("%s") "`", path);
|
PrintAndLogEx(SUCCESS, "loaded binary key file `" _YELLOW_("%s") "`", path);
|
||||||
|
free(path);
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue