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(a)redhat.com>
---
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