From 361cefb7d2725e83dc0ce6558967ccbde99138ab Mon Sep 17 00:00:00 2001 From: Aaron Burghardt Date: Sun, 30 Jun 2013 20:40:20 -0400 Subject: 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. --- tools/idevicebackup2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') 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")); -- cgit v1.1-32-gdbae