summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2011-09-28 02:57:27 +0200
committerGravatar Martin Szulecki2012-03-19 01:44:35 +0100
commit249ac33e36753daaeda7973a0d3cc7cb1f72948a (patch)
treeb3a536466272b42cbbf3f64964be61c71898aea4 /src
parent86495a1f22cd53399697dd558d65f50ed60dcdb4 (diff)
downloadlibimobiledevice-249ac33e36753daaeda7973a0d3cc7cb1f72948a.tar.gz
libimobiledevice-249ac33e36753daaeda7973a0d3cc7cb1f72948a.tar.bz2
free bio after using it
Diffstat (limited to 'src')
-rw-r--r--src/lockdown.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index f22fb08..6f55991 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -1205,9 +1205,11 @@ lockdownd_error_t lockdownd_gen_pair_cert(key_data_t public_key, key_data_t * od
if (USERPREF_E_SUCCESS == uret) {
/* copy buffer for output */
membp = BIO_new(BIO_s_mem());
- if (PEM_write_bio_X509(membp, dev_cert) > 0) {
+ if (membp && PEM_write_bio_X509(membp, dev_cert) > 0) {
odevice_cert->size = BIO_get_mem_data(membp, &odevice_cert->data);
}
+ if (membp)
+ free(membp);
ohost_cert->data = malloc(pem_host_cert.size);
memcpy(ohost_cert->data, pem_host_cert.data, pem_host_cert.size);