diff options
author | Aaron Burghardt | 2013-06-30 20:40:20 -0400 |
---|---|---|
committer | Aaron Burghardt | 2013-06-30 21:27:57 -0400 |
commit | 361cefb7d2725e83dc0ce6558967ccbde99138ab (patch) | |
tree | c80bd601f29e843a45424b9e032f743771a59351 /tools | |
parent | 6648ebcd3cf1fe2a9aab7d18f9ae535e2795b080 (diff) | |
download | libimobiledevice-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')
-rw-r--r-- | tools/idevicebackup2.c | 4 |
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")); |