summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup2.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2016-11-27 14:27:33 +0100
committerGravatar Nikias Bassen2016-11-27 14:27:33 +0100
commita1c728578930fb49e45497d1be7c9bc0c83607f1 (patch)
tree0f67d52c4ae11a7246b6e9e8bc01769d93154e29 /tools/idevicebackup2.c
parent23069d10341ce637fdad7321d447c53752dba48c (diff)
downloadlibimobiledevice-a1c728578930fb49e45497d1be7c9bc0c83607f1.tar.gz
libimobiledevice-a1c728578930fb49e45497d1be7c9bc0c83607f1.tar.bz2
idevicebackup2: Plug some small memory leaks
Diffstat (limited to 'tools/idevicebackup2.c')
-rw-r--r--tools/idevicebackup2.c16
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
351 plist_dict_set_item(adict, "iTunesMetadata", plist_copy(meta)); 351 plist_dict_set_item(adict, "iTunesMetadata", plist_copy(meta));
352 plist_dict_set_item(app_dict, bundle_id_str, adict); 352 plist_dict_set_item(app_dict, bundle_id_str, adict);
353 } 353 }
354 free(bundle_id_str);
354 } 355 }
355 if ((time(NULL) - starttime) > 5) { 356 if ((time(NULL) - starttime) > 5) {
356 // make sure our lockdown connection doesn't time out in case this takes longer 357 // make sure our lockdown connection doesn't time out in case this takes longer
@@ -2003,10 +2004,8 @@ checkpoint:
2003 2004
2004 /* process series of DLMessage* operations */ 2005 /* process series of DLMessage* operations */
2005 do { 2006 do {
2006 if (dlmsg) { 2007 free(dlmsg);
2007 free(dlmsg); 2008 dlmsg = NULL;
2008 dlmsg = NULL;
2009 }
2010 mobilebackup2_receive_message(mobilebackup2, &message, &dlmsg); 2009 mobilebackup2_receive_message(mobilebackup2, &message, &dlmsg);
2011 if (!message || !dlmsg) { 2010 if (!message || !dlmsg) {
2012 PRINT_VERBOSE(1, "Device is not ready yet. Going to try again in 2 seconds...\n"); 2011 PRINT_VERBOSE(1, "Device is not ready yet. Going to try again in 2 seconds...\n");
@@ -2236,11 +2235,9 @@ checkpoint:
2236 } 2235 }
2237 2236
2238files_out: 2237files_out:
2239 if (message) 2238 plist_free(message);
2240 plist_free(message);
2241 message = NULL; 2239 message = NULL;
2242 if (dlmsg) 2240 free(dlmsg);
2243 free(dlmsg);
2244 dlmsg = NULL; 2241 dlmsg = NULL;
2245 2242
2246 if (quit_flag > 0) { 2243 if (quit_flag > 0) {
@@ -2256,6 +2253,9 @@ files_out:
2256 } 2253 }
2257 } while (1); 2254 } while (1);
2258 2255
2256 plist_free(message);
2257 free(dlmsg);
2258
2259 /* report operation status to user */ 2259 /* report operation status to user */
2260 switch (cmd) { 2260 switch (cmd) {
2261 case CMD_CLOUD: 2261 case CMD_CLOUD: