tree_print: check for NULL after allocating err
authorJonas Maebe <jonas.maebe@elis.ugent.be>
Mon, 9 Dec 2013 21:02:35 +0000 (22:02 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Wed, 10 Dec 2014 17:35:18 +0000 (18:35 +0100)
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/x509v3/pcy_tree.c

index 47b1bf8..93470c3 100644 (file)
@@ -101,6 +101,8 @@ static void tree_print(char *str, X509_POLICY_TREE *tree,
        int i;
        BIO *err;
        err = BIO_new_fp(stderr, BIO_NOCLOSE);
+       if (err == NULL)
+               return;
        if (!curr)
                curr = tree->levels + tree->nlevel;
        else