From: Matt Caswell Date: Fri, 29 Apr 2016 10:29:50 +0000 (+0100) Subject: Check for a NULL return value from a call to X509_STORE_CTX_new() X-Git-Tag: OpenSSL_1_1_0-pre6~990 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=7001571330ce2e31234660c10ef26089a07b17c1 Check for a NULL return value from a call to X509_STORE_CTX_new() Reviewed-by: Rich Salz --- diff --git a/apps/crl.c b/apps/crl.c index 915c9ac741..d3fd4162c4 100644 --- a/apps/crl.c +++ b/apps/crl.c @@ -244,7 +244,7 @@ int crl_main(int argc, char **argv) if (lookup == NULL) goto end; ctx = X509_STORE_CTX_new(); - if (!X509_STORE_CTX_init(ctx, store, NULL, NULL)) { + if (ctx == NULL || !X509_STORE_CTX_init(ctx, store, NULL, NULL)) { BIO_printf(bio_err, "Error initialising X509 store\n"); goto end; }