summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Petr Uzel2010-04-11 10:52:16 +0200
committerGravatar Martin Szulecki2010-04-11 15:08:24 +0200
commit03b35d180586f28666f66510ac05e09a37f1f872 (patch)
tree92245fd5402b58d4a242b9f3871f010ddc4b7c2b
parent513160b362e57d20e30904be459304a0c29603c7 (diff)
downloadlibimobiledevice-03b35d180586f28666f66510ac05e09a37f1f872.tar.gz
libimobiledevice-03b35d180586f28666f66510ac05e09a37f1f872.tar.bz2
plug memory leak in lockdownd_gen_pair_cert()
-rw-r--r--src/lockdown.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index bc04fe9..8127456 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -1186,6 +1186,16 @@ lockdownd_error_t lockdownd_gen_pair_cert(gnutls_datum_t public_key, gnutls_datu
break;
}
}
+
+ if (essentially_null.data)
+ free(essentially_null.data);
+ gnutls_x509_crt_deinit(dev_cert);
+ gnutls_x509_crt_deinit(root_cert);
+ gnutls_x509_crt_deinit(host_cert);
+ gnutls_x509_privkey_deinit(fake_privkey);
+ gnutls_x509_privkey_deinit(root_privkey);
+ gnutls_x509_privkey_deinit(host_privkey);
+
}
gnutls_free(modulus.data);