diff options
author | Nikias Bassen | 2011-09-28 02:57:27 +0200 |
---|---|---|
committer | Martin Szulecki | 2012-03-19 01:44:35 +0100 |
commit | 249ac33e36753daaeda7973a0d3cc7cb1f72948a (patch) | |
tree | b3a536466272b42cbbf3f64964be61c71898aea4 /src | |
parent | 86495a1f22cd53399697dd558d65f50ed60dcdb4 (diff) | |
download | libimobiledevice-249ac33e36753daaeda7973a0d3cc7cb1f72948a.tar.gz libimobiledevice-249ac33e36753daaeda7973a0d3cc7cb1f72948a.tar.bz2 |
free bio after using it
Diffstat (limited to 'src')
-rw-r--r-- | src/lockdown.c | 4 |
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); |