[PATCH 11/14] virCryptoEncryptDataAESgnutls: Use memset instead of VIR_DISPOSE_N

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Clear out the value using an explicit memset and free it with g_free so
that VIR_DISPOSE_N can be phased out.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/vircrypto.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/util/vircrypto.c b/src/util/vircrypto.c
index c4874550af..82281a070a 100644
--- a/src/util/vircrypto.c
+++ b/src/util/vircrypto.c
@@ -206,7 +206,8 @@ virCryptoEncryptDataAESgnutls(gnutls_cipher_algorithm_t gnutls_enc_alg,
     return 0;

  error:
-    VIR_DISPOSE_N(ciphertext, ciphertextlen);
+    memset(ciphertext, 0, ciphertextlen);
+    g_free(ciphertext);
     memset(&enc_key, 0, sizeof(gnutls_datum_t));
     memset(&iv_buf, 0, sizeof(gnutls_datum_t));
     return -1;
-- 
2.29.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux