]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[crypto] Return a NULL X.509 certificate if construction fails
authorMichael Brown <mcb30@ipxe.org>
Mon, 21 May 2012 22:00:08 +0000 (23:00 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 21 May 2012 22:21:36 +0000 (23:21 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/crypto/x509.c

index 18a8cebe0d36dcef008293ebb5b84ca2dfcdde12..2180173b0ecfb2bacbdd34b63d28c37a2efa97b6 100644 (file)
@@ -1068,6 +1068,7 @@ int x509_certificate ( const void *data, size_t len,
        /* Parse certificate */
        if ( ( rc = x509_parse ( *cert, &cursor ) ) != 0 ) {
                x509_put ( *cert );
+               *cert = NULL;
                return rc;
        }