Ensure CT_POLICY_EVAL_CTX_free behaves properly with a NULL arg
authorMatt Caswell <matt@openssl.org>
Mon, 22 Aug 2016 21:21:30 +0000 (22:21 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 22 Aug 2016 23:19:15 +0000 (00:19 +0100)
Reviewed-by: Tim Hudson <tjh@openssl.org>
crypto/ct/ct_policy.c

index 8bc9133..33738de 100644 (file)
@@ -30,6 +30,8 @@ CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void)
 
 void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx)
 {
+    if (ctx == NULL)
+        return;
     X509_free(ctx->cert);
     X509_free(ctx->issuer);
     OPENSSL_free(ctx);