summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-03-21 20:02:32 +0100
committerGravatar Martin Szulecki2014-03-21 20:02:32 +0100
commit74f83d758e041c26a2494f807e08d145cef94936 (patch)
tree043b4c74407e80e998ee8f7ec6d4108fe532c69b
parenta719dd9f3213a9f39ea5e6784595b351e2fcaa3a (diff)
downloadlibimobiledevice-74f83d758e041c26a2494f807e08d145cef94936.tar.gz
libimobiledevice-74f83d758e041c26a2494f807e08d145cef94936.tar.bz2
idevice: Plug memory leak by freeing pair_record
-rw-r--r--src/idevice.c6
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...");