Skip to content

Commit

Permalink
crypto: fix mistaken setting of Error in success code path
Browse files Browse the repository at this point in the history
The qcrypto_tls_session_check_certificate() method was setting
an Error even when the ACL check suceeded. This didn't affect
the callers detection of errors because they relied on the
function return status, but this did cause a memory leak since
the caller would not free an Error they did not expect to be
set.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
  • Loading branch information
berrange committed Nov 18, 2015
1 parent 61b9251 commit 6ef8cd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/tlssession.c
Expand Up @@ -304,9 +304,9 @@ qcrypto_tls_session_check_certificate(QCryptoTLSSession *session,

allow = qemu_acl_party_is_allowed(acl, session->peername);

error_setg(errp, "TLS x509 ACL check for %s is %s",
session->peername, allow ? "allowed" : "denied");
if (!allow) {
error_setg(errp, "TLS x509 ACL check for %s is denied",
session->peername);
goto error;
}
}
Expand Down

0 comments on commit 6ef8cd7

Please sign in to comment.