summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-05-01 14:01:56 +0200
committerGravatar Nikias Bassen2014-05-01 14:01:56 +0200
commitf9084ecb1a2274793e3819457920fc5c18f59140 (patch)
tree0cec88af5f1db759724c063571aad8e64129ef5d
parent7aa87fe71df068e798fe002ac785477d4e22c918 (diff)
downloadideviceinstaller-f9084ecb1a2274793e3819457920fc5c18f59140.tar.gz
ideviceinstaller-f9084ecb1a2274793e3819457920fc5c18f59140.tar.bz2
Plug some small memory leaks
-rw-r--r--src/ideviceinstaller.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
index fc22446..256e841 100644
--- a/src/ideviceinstaller.c
+++ b/src/ideviceinstaller.c
@@ -554,6 +554,7 @@ int main(int argc, char **argv)
554 idevice_t phone = NULL; 554 idevice_t phone = NULL;
555 lockdownd_client_t client = NULL; 555 lockdownd_client_t client = NULL;
556 instproxy_client_t ipc = NULL; 556 instproxy_client_t ipc = NULL;
557 instproxy_error_t err;
557 np_client_t np = NULL; 558 np_client_t np = NULL;
558 afc_client_t afc = NULL; 559 afc_client_t afc = NULL;
559#ifdef HAVE_LIBIMOBILEDEVICE_1_1_5 560#ifdef HAVE_LIBIMOBILEDEVICE_1_1_5
@@ -587,7 +588,16 @@ int main(int argc, char **argv)
587 goto leave_cleanup; 588 goto leave_cleanup;
588 } 589 }
589 590
590 if (np_client_new(phone, service, &np) != NP_E_SUCCESS) { 591 np_error_t nperr = np_client_new(phone, service, &np);
592#ifdef HAVE_LIBIMOBILEDEVICE_1_1_5
593 if (service) {
594 lockdownd_service_descriptor_free(service);
595 }
596 service = NULL;
597#else
598 service = 0;
599#endif
600 if (nperr != NP_E_SUCCESS) {
591 fprintf(stderr, "Could not connect to notification_proxy!\n"); 601 fprintf(stderr, "Could not connect to notification_proxy!\n");
592 goto leave_cleanup; 602 goto leave_cleanup;
593 } 603 }
@@ -618,7 +628,16 @@ run_again:
618 goto leave_cleanup; 628 goto leave_cleanup;
619 } 629 }
620 630
621 if (instproxy_client_new(phone, service, &ipc) != INSTPROXY_E_SUCCESS) { 631 err = instproxy_client_new(phone, service, &ipc);
632#ifdef HAVE_LIBIMOBILEDEVICE_1_1_5
633 if (service) {
634 lockdownd_service_descriptor_free(service);
635 }
636 service = NULL;
637#else
638 service = 0;
639#endif
640 if (err != INSTPROXY_E_SUCCESS) {
622 fprintf(stderr, "Could not connect to installation_proxy!\n"); 641 fprintf(stderr, "Could not connect to installation_proxy!\n");
623 goto leave_cleanup; 642 goto leave_cleanup;
624 } 643 }
@@ -635,7 +654,6 @@ run_again:
635 int xml_mode = 0; 654 int xml_mode = 0;
636 plist_t client_opts = instproxy_client_options_new(); 655 plist_t client_opts = instproxy_client_options_new();
637 instproxy_client_options_add(client_opts, "ApplicationType", "User", NULL); 656 instproxy_client_options_add(client_opts, "ApplicationType", "User", NULL);
638 instproxy_error_t err;
639 plist_t apps = NULL; 657 plist_t apps = NULL;
640 658
641 /* look for options */ 659 /* look for options */
@@ -1056,7 +1074,6 @@ run_again:
1056 int xml_mode = 0; 1074 int xml_mode = 0;
1057 plist_t dict = NULL; 1075 plist_t dict = NULL;
1058 plist_t lres = NULL; 1076 plist_t lres = NULL;
1059 instproxy_error_t err;
1060 1077
1061 /* look for options */ 1078 /* look for options */
1062 if (options) { 1079 if (options) {