summaryrefslogtreecommitdiff
path: root/tests/moredn.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-06-05 22:17:45 +0200
committerSimon Josefsson <simon@josefsson.org>2008-06-05 22:17:45 +0200
commit4b7a81cbc5a4da1838a110c13e7c4a7a5048db9d (patch)
treec1fa509d0a8b63c3709226e308b69470a71c88dc /tests/moredn.c
parent27f1121e40e999f3ca4b1de947057c03ec3fdc6a (diff)
downloadgnutls-4b7a81cbc5a4da1838a110c13e7c4a7a5048db9d.tar.gz
Fix memory leak.
Diffstat (limited to 'tests/moredn.c')
-rw-r--r--tests/moredn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/moredn.c b/tests/moredn.c
index 9226a5a9a9..c98153f28b 100644
--- a/tests/moredn.c
+++ b/tests/moredn.c
@@ -58,8 +58,6 @@ static const gnutls_datum_t cert_datum = { (char *)cert_pem,
void
doit (void)
{
-
- gnutls_global_init ();
gnutls_x509_crt_t cert;
gnutls_x509_dn_t sdn, dn2;
unsigned char buf[8192], buf2[8192];
@@ -67,6 +65,8 @@ doit (void)
gnutls_datum_t datum;
int rv;
+ gnutls_global_init ();
+
if (gnutls_x509_crt_init(&cert) == 0)
success ("success: cert init\n");
else
@@ -119,4 +119,6 @@ doit (void)
gnutls_x509_dn_deinit (dn2);
gnutls_x509_crt_deinit (cert);
+
+ gnutls_global_deinit ();
}