From 132a9f1d7003a54c20abc81fa5f6833f09ffa13b Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 5 Nov 2013 21:42:55 +0100 Subject: userpref: Fix memory leak in userpref_device_record_get_certs_as_pem() --- common/userpref.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 } } + if (root_cert) + plist_free(root_cert); + if (host_cert) + plist_free(host_cert); + if (dev_cert) + plist_free(dev_cert); + return USERPREF_E_SUCCESS; } else { if (pem_root_cert->data) { -- cgit v1.1-32-gdbae