mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fix: mem leaks.
This commit is contained in:
parent
44392c6afc
commit
6d63b3fbed
9 changed files with 28 additions and 12 deletions
|
@ -266,8 +266,8 @@ int loadFile(const char *preferredName, const char *suffix, void* data, size_t*
|
|||
FILE *f = fopen(fileName, "rb");
|
||||
if ( !f ) {
|
||||
PrintAndLogDevice(WARNING, "file not found or locked. '" _YELLOW_(%s)"'", fileName);
|
||||
retval = 1;
|
||||
goto out;
|
||||
free(fileName);
|
||||
return 1;
|
||||
}
|
||||
|
||||
// get filesize in order to malloc memory
|
||||
|
@ -310,7 +310,12 @@ int loadFile(const char *preferredName, const char *suffix, void* data, size_t*
|
|||
|
||||
out:
|
||||
fclose(f);
|
||||
|
||||
if (data)
|
||||
free(data);
|
||||
|
||||
free(fileName);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue