提交 4f4f6976 编写于 作者: P Paolo Bonzini

crypto: fix builtin qcrypto_cipher_free

This was dereferencing a pointer before checking if it was NULL.
Reported-by: NChristian Borntraeger <borntraeger@de.ibm.com>
Reported-by: NAurelien Jarno <aurelien@aurel32.net>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 d09a6fde
......@@ -354,11 +354,13 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
void qcrypto_cipher_free(QCryptoCipher *cipher)
{
QCryptoCipherBuiltin *ctxt = cipher->opaque;
QCryptoCipherBuiltin *ctxt;
if (!cipher) {
return;
}
ctxt = cipher->opaque;
ctxt->free(cipher);
g_free(cipher);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册