diff options
| author | 2013-11-05 21:42:55 +0100 | |
|---|---|---|
| committer | 2013-11-06 20:31:50 +0100 | |
| commit | 132a9f1d7003a54c20abc81fa5f6833f09ffa13b (patch) | |
| tree | 0bc74df646e5183983ac6641db2bcbd9ce9b90f8 | |
| parent | 763896dd2592cbc980cac8e63841202620c078f6 (diff) | |
| download | libimobiledevice-132a9f1d7003a54c20abc81fa5f6833f09ffa13b.tar.gz libimobiledevice-132a9f1d7003a54c20abc81fa5f6833f09ffa13b.tar.bz2 | |
userpref: Fix memory leak in userpref_device_record_get_certs_as_pem()
| -rw-r--r-- | common/userpref.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/userpref.c b/common/userpref.c index 0d32f9e..c76fca5 100644 --- a/common/userpref.c +++ b/common/userpref.c | |||
| @@ -1128,6 +1128,13 @@ userpref_error_t userpref_device_record_get_certs_as_pem(const char *udid, key_d | |||
| 1128 | } | 1128 | } |
| 1129 | } | 1129 | } |
| 1130 | 1130 | ||
| 1131 | if (root_cert) | ||
| 1132 | plist_free(root_cert); | ||
| 1133 | if (host_cert) | ||
| 1134 | plist_free(host_cert); | ||
| 1135 | if (dev_cert) | ||
| 1136 | plist_free(dev_cert); | ||
| 1137 | |||
| 1131 | return USERPREF_E_SUCCESS; | 1138 | return USERPREF_E_SUCCESS; |
| 1132 | } else { | 1139 | } else { |
| 1133 | if (pem_root_cert->data) { | 1140 | if (pem_root_cert->data) { |
