From 80140f20a814bfe8114ead3915a19ceca7144201 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Fri, 28 Apr 2017 22:46:48 +0200 Subject: pkcs12: release CRL data on error path This addresses issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1295 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 e71d1f01db..16a015cb7d 100644 --- a/lib/x509/pkcs12.c +++ b/lib/x509/pkcs12.c @@ -1787,6 +1787,10 @@ gnutls_pkcs12_simple_parse(gnutls_pkcs12_t p12, gnutls_x509_privkey_deinit(*key); *key = NULL; } + if (crl != NULL && *crl != NULL) { + gnutls_x509_crl_deinit(*crl); + *crl = NULL; + } if (_extra_certs_len && _extra_certs != NULL) { for (i = 0; i < _extra_certs_len; i++) gnutls_x509_crt_deinit(_extra_certs[i]); -- cgit v1.2.1