summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup2.c
diff options
context:
space:
mode:
authorGravatar Aaron Burghardt2013-06-30 20:40:20 -0400
committerGravatar Aaron Burghardt2013-06-30 21:27:57 -0400
commit361cefb7d2725e83dc0ce6558967ccbde99138ab (patch)
treec80bd601f29e843a45424b9e032f743771a59351 /tools/idevicebackup2.c
parent6648ebcd3cf1fe2a9aab7d18f9ae535e2795b080 (diff)
downloadlibimobiledevice-361cefb7d2725e83dc0ce6558967ccbde99138ab.tar.gz
libimobiledevice-361cefb7d2725e83dc0ce6558967ccbde99138ab.tar.bz2
Fixed memory leak by creating empty plist dict for iTunes settings only when it can’t be retrieved from the lockdown connection. That mimics the leaking implementation, but maybe it should be an error.
Diffstat (limited to 'tools/idevicebackup2.c')
-rw-r--r--tools/idevicebackup2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 697e276..8921403 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -354,9 +354,9 @@ static plist_t mobilebackup_factory_info_plist_new(const char* udid, lockdownd_c
}
plist_dict_insert_item(ret, "iTunes Files", files);
- plist_t itunes_settings = plist_new_dict();
+ plist_t itunes_settings = NULL;
lockdownd_get_value(lockdown, "com.apple.iTunes", NULL, &itunes_settings);
- plist_dict_insert_item(ret, "iTunes Settings", itunes_settings);
+ plist_dict_insert_item(ret, "iTunes Settings", itunes_settings ? itunes_settings : plist_new_dict());
plist_dict_insert_item(ret, "iTunes Version", plist_new_string("10.0.1"));