]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls_pkcs12_simple_parse: set to null vars after deinitialization
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Sun, 30 Apr 2017 11:25:16 +0000 (13:25 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Sun, 30 Apr 2017 11:27:13 +0000 (13:27 +0200)
This avoids having the variables being deinitialized twice during
cleanup.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
lib/x509/pkcs12.c

index 16a015cb7dc96cfbf3322d62474a6212cb8aedda..2b7b8d6402f680dd4b64c7b91264913fb425af58 100644 (file)
@@ -1670,6 +1670,7 @@ gnutls_pkcs12_simple_parse(gnutls_pkcs12_t p12,
                                if (ret < 0) {
                                        gnutls_assert();
                                        gnutls_x509_crt_deinit(this_cert);
+                                       this_cert = NULL;
                                        goto done;
                                }
 
@@ -1682,6 +1683,7 @@ gnutls_pkcs12_simple_parse(gnutls_pkcs12_t p12,
                                if (ret < 0) {
                                        gnutls_assert();
                                        gnutls_x509_crt_deinit(this_cert);
+                                       this_cert = NULL;
                                        goto done;
                                }
 
@@ -1721,6 +1723,7 @@ gnutls_pkcs12_simple_parse(gnutls_pkcs12_t p12,
                                        } else {
                                                gnutls_x509_crt_deinit
                                                    (this_cert);
+                                               this_cert = NULL;
                                        }
                                }
                                break;
@@ -1743,6 +1746,7 @@ gnutls_pkcs12_simple_parse(gnutls_pkcs12_t p12,
                                if (ret < 0) {
                                        gnutls_assert();
                                        gnutls_x509_crl_deinit(*crl);
+                                       *crl = NULL;
                                        goto done;
                                }
                                break;