diff options
author | Nikias Bassen | 2016-11-27 14:27:33 +0100 |
---|---|---|
committer | Nikias Bassen | 2016-11-27 14:27:33 +0100 |
commit | a1c728578930fb49e45497d1be7c9bc0c83607f1 (patch) | |
tree | 0f67d52c4ae11a7246b6e9e8bc01769d93154e29 | |
parent | 23069d10341ce637fdad7321d447c53752dba48c (diff) | |
download | libimobiledevice-a1c728578930fb49e45497d1be7c9bc0c83607f1.tar.gz libimobiledevice-a1c728578930fb49e45497d1be7c9bc0c83607f1.tar.bz2 |
idevicebackup2: Plug some small memory leaks
-rw-r--r-- | tools/idevicebackup2.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index bb7f5c3..8dc32c5 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c @@ -351,6 +351,7 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid, idevice_t d plist_dict_set_item(adict, "iTunesMetadata", plist_copy(meta)); plist_dict_set_item(app_dict, bundle_id_str, adict); } + free(bundle_id_str); } if ((time(NULL) - starttime) > 5) { // make sure our lockdown connection doesn't time out in case this takes longer @@ -2003,10 +2004,8 @@ checkpoint: /* process series of DLMessage* operations */ do { - if (dlmsg) { - free(dlmsg); - dlmsg = NULL; - } + free(dlmsg); + dlmsg = NULL; mobilebackup2_receive_message(mobilebackup2, &message, &dlmsg); if (!message || !dlmsg) { PRINT_VERBOSE(1, "Device is not ready yet. Going to try again in 2 seconds...\n"); @@ -2236,11 +2235,9 @@ checkpoint: } files_out: - if (message) - plist_free(message); + plist_free(message); message = NULL; - if (dlmsg) - free(dlmsg); + free(dlmsg); dlmsg = NULL; if (quit_flag > 0) { @@ -2256,6 +2253,9 @@ files_out: } } while (1); + plist_free(message); + free(dlmsg); + /* report operation status to user */ switch (cmd) { case CMD_CLOUD: |