From 04ba663cfefe1acd20ce303c1d0357fc6f44da78 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 7 Oct 2014 16:46:38 +0200 Subject: idevicedebug: Fix small memory leak --- tools/idevicedebug.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'tools/idevicedebug.c') diff --git a/tools/idevicedebug.c b/tools/idevicedebug.c index 850a4b1..dcdb6b6 100644 --- a/tools/idevicedebug.c +++ b/tools/idevicedebug.c @@ -328,12 +328,17 @@ int main(int argc, char *argv[]) instproxy_client_get_path_for_bundle_identifier(instproxy_client, bundle_identifier, &path); instproxy_client_free(instproxy_client); instproxy_client = NULL; - if (container && plist_get_node_type(container) == PLIST_STRING) { - plist_get_string_val(container, &working_directory); - debug_info("working_directory: %s\n", working_directory); - } else { - fprintf(stderr, "Could not determine container path for bundle identifier %s.\n", bundle_identifier); - goto cleanup; + + if (container) { + if (plist_get_node_type(container) == PLIST_STRING) { + plist_get_string_val(container, &working_directory); + debug_info("working_directory: %s\n", working_directory); + plist_free(container); + } else { + plist_free(container); + fprintf(stderr, "Could not determine container path for bundle identifier %s.\n", bundle_identifier); + goto cleanup; + } } /* start and connect to debugserver */ -- cgit v1.1-32-gdbae