diff options
-rw-r--r-- | apps/lib/apps.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/lib/apps.c b/apps/lib/apps.c index 7ca30ef590..77edc1d936 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -691,10 +691,13 @@ int load_cert_certs(const char *uri, if (ret) { if (pcert != NULL) warn_cert(uri, *pcert, 0, vpm); - warn_certs(uri, *pcerts, 1, vpm); + if (pcerts != NULL) + warn_certs(uri, *pcerts, 1, vpm); } else { - OSSL_STACK_OF_X509_free(*pcerts); - *pcerts = NULL; + if (pcerts != NULL) { + OSSL_STACK_OF_X509_free(*pcerts); + *pcerts = NULL; + } } return ret; } |