hx509: Fix coverity warnings

This commit is contained in:
Nicolas Williams
2022-01-17 17:36:48 -06:00
parent 2e729a9aa2
commit dd71303a2f
7 changed files with 39 additions and 19 deletions

View File

@@ -191,8 +191,9 @@ match_localkeyid(hx509_context context,
q.local_key_id = &value->localKeyId;
ret = hx509_certs_find(context, certs, &q, &cert);
if (ret == 0 && cert == NULL)
ret = HX509_CERT_NOT_FOUND;
if (ret == 0) {
if (value->private_key)
_hx509_cert_assign_key(cert, value->private_key);
hx509_cert_free(cert);