diff --git a/crypto/x509-utils.c b/crypto/x509-utils.c index 39bb6d4d8c..1843488bca 100644 --- a/crypto/x509-utils.c +++ b/crypto/x509-utils.c @@ -46,7 +46,8 @@ int qcrypto_get_x509_cert_fingerprint(uint8_t *cert, size_t size, return -1; } - if (gnutls_x509_crt_init(&crt) < 0) { + ret = gnutls_x509_crt_init(&crt); + if (ret < 0) { error_setg(errp, "Unable to initialize certificate: %s", gnutls_strerror(ret)); return -1;