[PATCH 12/14] storageBackendCreateQemuImgSecretPath: 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/storage/storage_util.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index 3d8de16341..303ba5fa70 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -1314,7 +1314,10 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool,

  cleanup:
     virObjectUnref(conn);
-    VIR_DISPOSE_N(secret, secretlen);
+    if (secret) {
+        memset(secret, 0, 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