From: Peter Krempa Date: Tue, 2 Feb 2021 16:05:23 +0000 (+0100) Subject: cmdSecretGetValue: Use virSecureEraseString instead of VIR_AUTODISPOSE_STR X-Git-Tag: v7.1.0-rc1~308 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1709a68a5ca687bfbda8ee57e1753660b5d2aa6;p=thirdparty%2Flibvirt.git cmdSecretGetValue: Use virSecureEraseString instead of VIR_AUTODISPOSE_STR Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrangé --- 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);