mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
fix savejson mem leaks
This commit is contained in:
parent
6338a9edbb
commit
8c726c157b
1 changed files with 4 additions and 4 deletions
|
@ -573,16 +573,16 @@ int saveFileJSONex(const char *preferredName, JSONFileType ftype, uint8_t *data,
|
||||||
int res = json_dump_file(root, fileName, JSON_INDENT(2));
|
int res = json_dump_file(root, fileName, JSON_INDENT(2));
|
||||||
if (res) {
|
if (res) {
|
||||||
PrintAndLogEx(FAILED, "error: can't save the file: " _YELLOW_("%s"), fileName);
|
PrintAndLogEx(FAILED, "error: can't save the file: " _YELLOW_("%s"), fileName);
|
||||||
json_decref(root);
|
|
||||||
retval = 200;
|
retval = 200;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (verbose)
|
|
||||||
PrintAndLogEx(SUCCESS, "saved to json file " _YELLOW_("%s"), fileName);
|
|
||||||
|
|
||||||
json_decref(root);
|
if (verbose) {
|
||||||
|
PrintAndLogEx(SUCCESS, "saved to json file " _YELLOW_("%s"), fileName);
|
||||||
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
json_decref(root);
|
||||||
free(fileName);
|
free(fileName);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue