diff options
author | Martin Szulecki | 2014-03-21 20:02:32 +0100 |
---|---|---|
committer | Martin Szulecki | 2014-03-21 20:02:32 +0100 |
commit | 74f83d758e041c26a2494f807e08d145cef94936 (patch) | |
tree | 043b4c74407e80e998ee8f7ec6d4108fe532c69b | |
parent | a719dd9f3213a9f39ea5e6784595b351e2fcaa3a (diff) | |
download | libimobiledevice-74f83d758e041c26a2494f807e08d145cef94936.tar.gz libimobiledevice-74f83d758e041c26a2494f807e08d145cef94936.tar.bz2 |
idevice: Plug memory leak by freeing pair_record
-rw-r--r-- | src/idevice.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/idevice.c b/src/idevice.c index 065d55c..dce4b41 100644 --- a/src/idevice.c +++ b/src/idevice.c @@ -688,6 +688,9 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection) pair_record_import_crt_with_name(pair_record, USERPREF_ROOT_CERTIFICATE_KEY, &root_cert); pair_record_import_key_with_name(pair_record, USERPREF_ROOT_PRIVATE_KEY_KEY, &root_privkey); + if (pair_record) + plist_free(pair_record); + /* Set up OpenSSL */ if (openssl_init_done == 0) { SSL_library_init(); @@ -777,6 +780,9 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection) pair_record_import_key_with_name(pair_record, USERPREF_ROOT_PRIVATE_KEY_KEY, ssl_data_loc->root_privkey); pair_record_import_key_with_name(pair_record, USERPREF_HOST_PRIVATE_KEY_KEY, ssl_data_loc->host_privkey); + if (pair_record) + plist_free(pair_record); + debug_info("GnuTLS step 1..."); gnutls_transport_set_ptr(ssl_data_loc->session, (gnutls_transport_ptr_t)connection); debug_info("GnuTLS step 2..."); |