diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-08-24 15:09:08 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-08-24 15:12:25 +0200 |
commit | d5d2cbceea3ac8bc64b956cbb5eb32de6a2aba6a (patch) | |
tree | bcf8a4a77a202bdfbb3ae92a5594900a2cdbb5a0 | |
parent | f49535991e36f2df7ac3329a40beac6524258e3a (diff) | |
download | gnutls_2_12_x-psk-fix.tar.gz |
tests: eliminated memory leak in openpgpselfgnutls_2_12_x-psk-fix
-rw-r--r-- | tests/openpgpself.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/openpgpself.c b/tests/openpgpself.c index 63c1e47326..a3a4269b3f 100644 --- a/tests/openpgpself.c +++ b/tests/openpgpself.c @@ -258,7 +258,7 @@ end: #define DH_BITS 1024 /* These are global */ -gnutls_certificate_credentials_t pgp_cred; +gnutls_certificate_credentials_t pgp_cred = NULL; static gnutls_session_t initialize_tls_session (void) @@ -560,6 +560,7 @@ server (void) { if (j==0 || use_only_1024) { + if (pgp_cred) gnutls_certificate_free_credentials (pgp_cred); gnutls_certificate_allocate_credentials (&pgp_cred); ret = gnutls_certificate_set_openpgp_key_mem2 (pgp_cred, &server_crt, &server_key, "auto", |