From 7265612d87f51c2f52a2e4cf5bdf14f31bd291a2 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 30 Apr 2017 13:25:16 +0200 Subject: 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 --- lib/x509/pkcs12.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.1