From 8c726c157ba5db8713fec2107d7545c7a1e1582f Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 7 Oct 2020 00:04:20 +0200 Subject: [PATCH] fix savejson mem leaks --- client/src/fileutils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/fileutils.c b/client/src/fileutils.c index be6cab977..9b6482a66 100644 --- a/client/src/fileutils.c +++ b/client/src/fileutils.c @@ -573,16 +573,16 @@ int saveFileJSONex(const char *preferredName, JSONFileType ftype, uint8_t *data, int res = json_dump_file(root, fileName, JSON_INDENT(2)); if (res) { PrintAndLogEx(FAILED, "error: can't save the file: " _YELLOW_("%s"), fileName); - json_decref(root); retval = 200; 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: + json_decref(root); free(fileName); return retval; }