diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2019-07-23 15:29:40 +0100 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2019-08-22 10:47:12 +0100 |
commit | 133cf1e5b1a9a3cc6f1e47e5edad67d000259dd6 (patch) | |
tree | 74c690191bb11a19e2a32a2440bf0af4f9d44d75 /include/crypto/cipher.h | |
parent | 00f2cfbbec63fb6f5a7789797a62ccedd22466ea (diff) |
crypto: define cleanup functions for use with g_autoptr
Allow crypto structs to be used with g_autoptr, avoiding the need to
explicitly call XXX_free() functions when variables go out of scope on
the stack.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'include/crypto/cipher.h')
-rw-r--r-- | include/crypto/cipher.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h index cac90b410c..5928e5ecc7 100644 --- a/include/crypto/cipher.h +++ b/include/crypto/cipher.h @@ -170,6 +170,8 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg, */ void qcrypto_cipher_free(QCryptoCipher *cipher); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoCipher, qcrypto_cipher_free) + /** * qcrypto_cipher_encrypt: * @cipher: the cipher object |