[PATCH v2 16/27] storageBackendCreateQemuImgSecretPath: Use virSecureErase instead of VIR_DISPOSE_N

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

 



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

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

diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 3d8de16341..b5adb05826 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -74,6 +74,7 @@
 #include "virxml.h"
 #include "virfdstream.h"
 #include "virutil.h"
+#include "virsecureerase.h"

 #define VIR_FROM_THIS VIR_FROM_STORAGE

@@ -1314,7 +1315,8 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool,

  cleanup:
     virObjectUnref(conn);
-    VIR_DISPOSE_N(secret, secretlen);
+    virSecureErase(secret, secretlen);
+    g_free(secret);

     return secretPath;

-- 
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