diff options
| author | 2014-03-21 20:02:32 +0100 | |
|---|---|---|
| committer | 2014-03-21 20:02:32 +0100 | |
| commit | 74f83d758e041c26a2494f807e08d145cef94936 (patch) | |
| tree | 043b4c74407e80e998ee8f7ec6d4108fe532c69b /src/idevice.c | |
| parent | a719dd9f3213a9f39ea5e6784595b351e2fcaa3a (diff) | |
| download | libimobiledevice-74f83d758e041c26a2494f807e08d145cef94936.tar.gz libimobiledevice-74f83d758e041c26a2494f807e08d145cef94936.tar.bz2 | |
idevice: Plug memory leak by freeing pair_record
Diffstat (limited to 'src/idevice.c')
| -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) | |||
| 688 | pair_record_import_crt_with_name(pair_record, USERPREF_ROOT_CERTIFICATE_KEY, &root_cert); | 688 | pair_record_import_crt_with_name(pair_record, USERPREF_ROOT_CERTIFICATE_KEY, &root_cert); |
| 689 | pair_record_import_key_with_name(pair_record, USERPREF_ROOT_PRIVATE_KEY_KEY, &root_privkey); | 689 | pair_record_import_key_with_name(pair_record, USERPREF_ROOT_PRIVATE_KEY_KEY, &root_privkey); |
| 690 | 690 | ||
| 691 | if (pair_record) | ||
| 692 | plist_free(pair_record); | ||
| 693 | |||
| 691 | /* Set up OpenSSL */ | 694 | /* Set up OpenSSL */ |
| 692 | if (openssl_init_done == 0) { | 695 | if (openssl_init_done == 0) { |
| 693 | SSL_library_init(); | 696 | SSL_library_init(); |
| @@ -777,6 +780,9 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection) | |||
| 777 | pair_record_import_key_with_name(pair_record, USERPREF_ROOT_PRIVATE_KEY_KEY, ssl_data_loc->root_privkey); | 780 | pair_record_import_key_with_name(pair_record, USERPREF_ROOT_PRIVATE_KEY_KEY, ssl_data_loc->root_privkey); |
| 778 | pair_record_import_key_with_name(pair_record, USERPREF_HOST_PRIVATE_KEY_KEY, ssl_data_loc->host_privkey); | 781 | pair_record_import_key_with_name(pair_record, USERPREF_HOST_PRIVATE_KEY_KEY, ssl_data_loc->host_privkey); |
| 779 | 782 | ||
| 783 | if (pair_record) | ||
| 784 | plist_free(pair_record); | ||
| 785 | |||
| 780 | debug_info("GnuTLS step 1..."); | 786 | debug_info("GnuTLS step 1..."); |
| 781 | gnutls_transport_set_ptr(ssl_data_loc->session, (gnutls_transport_ptr_t)connection); | 787 | gnutls_transport_set_ptr(ssl_data_loc->session, (gnutls_transport_ptr_t)connection); |
| 782 | debug_info("GnuTLS step 2..."); | 788 | debug_info("GnuTLS step 2..."); |
