]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
system-key-win: call CertFreeCertificateContext()
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 22 Jan 2016 11:59:47 +0000 (12:59 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 22 Jan 2016 12:04:10 +0000 (13:04 +0100)
lib/system-keys-win.c

index 419d3f706bbb001c5f1fae219ca39f751133ab7d..1f5ffad4a2edaa90145dec73d96798367fd00997 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Copyright © 2014 Red Hat, Inc.
- * Copyright © 2015 Dyalog Ltd.
+ * Copyright © 2014-2016 Red Hat, Inc.
+ * Copyright © 2015-2016 Dyalog Ltd.
  *
  * Author: Nikos Mavrogiannopoulos, Bjørn Christensen
  *
@@ -767,6 +767,9 @@ _gnutls_privkey_import_system_url(gnutls_privkey_t pkey,
 
        gnutls_free(kpi);
 
+       if (cert != 0)
+               CertFreeCertificateContext(cert);
+
        CertCloseStore(store, 0);
        return ret;
 }
@@ -828,6 +831,9 @@ _gnutls_x509_crt_import_system_url(gnutls_x509_crt_t crt, const char *url)
 
        ret = 0;
  cleanup:
+       if (cert != 0)
+               CertFreeCertificateContext(cert);
+
        CertCloseStore(store, 0);
        return ret;
 }