[PATCH v2 23/27] cmdSecretGetValue: Use virSecureEraseString instead of VIR_AUTODISPOSE_STR

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tools/virsh-secret.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c
index de32f25d64..fcfbe5fe9e 100644
--- a/tools/virsh-secret.c
+++ b/tools/virsh-secret.c
@@ -302,7 +302,6 @@ static bool
 cmdSecretGetValue(vshControl *ctl, const vshCmd *cmd)
 {
     g_autoptr(virshSecret) secret = NULL;
-    VIR_AUTODISPOSE_STR base64 = NULL;
     g_autofree unsigned char *value = NULL;
     size_t value_size;
     bool plain = vshCommandOptBool(cmd, "plain");
@@ -320,9 +319,10 @@ cmdSecretGetValue(vshControl *ctl, const vshCmd *cmd)
             return false;
         }
     } else {
-        base64 = g_base64_encode(value, value_size);
+        g_autofree char *base64 = g_base64_encode(value, value_size);

         vshPrint(ctl, "%s", base64);
+        virSecureEraseString(base64);
     }

     virSecureErase(value, value_size);
-- 
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