From: Nikos Mavrogiannopoulos Date: Sun, 30 Apr 2017 11:25:16 +0000 (+0200) Subject: gnutls_pkcs12_simple_parse: set to null vars after deinitialization X-Git-Tag: gnutls_3_6_0~606 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7265612d87f51c2f52a2e4cf5bdf14f31bd291a2;p=thirdparty%2Fgnutls.git gnutls_pkcs12_simple_parse: set to null vars after deinitialization This avoids having the variables being deinitialized twice during cleanup. Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/lib/x509/pkcs12.c b/lib/x509/pkcs12.c index 16a015cb7d..2b7b8d6402 100644 --- a/lib/x509/pkcs12.c +++ b/lib/x509/pkcs12.c @@ -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;