Browse Source

[crypto] Return a NULL X.509 certificate if construction fails

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
c923d57663
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      src/crypto/x509.c

+ 1
- 0
src/crypto/x509.c View File

@@ -1068,6 +1068,7 @@ int x509_certificate ( const void *data, size_t len,
1068 1068
 	/* Parse certificate */
1069 1069
 	if ( ( rc = x509_parse ( *cert, &cursor ) ) != 0 ) {
1070 1070
 		x509_put ( *cert );
1071
+		*cert = NULL;
1071 1072
 		return rc;
1072 1073
 	}
1073 1074
 

Loading…
Cancel
Save