Skip to content

Commit

Permalink
efi_x509: fix an error handling in is_immediate_ca()
Browse files Browse the repository at this point in the history
X509cert is allocated when converting X509ca, so we should free it
in case d2i_X509 fails to convert X509ca.

Signed-off-by: Gary Lin <[email protected]>
  • Loading branch information
lcp committed Jun 28, 2021
1 parent 3e7bc30 commit b3c6da7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/efi_x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ is_immediate_ca (const uint8_t *cert, const uint32_t cert_size,

X509ca = d2i_X509 (NULL, &ca_cert, ca_cert_size);
if (X509ca == NULL)
return 0;
goto err;

cert_store = X509_STORE_new ();
if (cert_store == NULL)
Expand Down

0 comments on commit b3c6da7

Please sign in to comment.