From: Alberto Leiva Popper Date: Tue, 3 Oct 2023 15:37:57 +0000 (-0600) Subject: Release CRL on error branch X-Git-Tag: 1.6.0~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92ef361379be964f92920a58764b805f0e5f7c0a;p=thirdparty%2FFORT-validator.git Release CRL on error branch Fixes memory leak. --- diff --git a/src/object/crl.c b/src/object/crl.c index 407d8d59..2cd0de3b 100644 --- a/src/object/crl.c +++ b/src/object/crl.c @@ -154,12 +154,18 @@ int crl_load(struct rpki_uri *uri, X509_CRL **result) { int error; + pr_val_debug("CRL '%s' {", uri_val_get_printable(uri)); error = __crl_load(uri, result); - if (!error) - error = crl_validate(*result); + if (error) + goto end; + error = crl_validate(*result); + if (error) + X509_CRL_free(*result); + +end: pr_val_debug("}"); return error; }