mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
cmdSecretGetValue: Use virSecureEraseString instead of VIR_AUTODISPOSE_STR
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
7f0780c0d2
commit
a1709a68a5
@ -302,7 +302,6 @@ static bool
|
|||||||
cmdSecretGetValue(vshControl *ctl, const vshCmd *cmd)
|
cmdSecretGetValue(vshControl *ctl, const vshCmd *cmd)
|
||||||
{
|
{
|
||||||
g_autoptr(virshSecret) secret = NULL;
|
g_autoptr(virshSecret) secret = NULL;
|
||||||
VIR_AUTODISPOSE_STR base64 = NULL;
|
|
||||||
g_autofree unsigned char *value = NULL;
|
g_autofree unsigned char *value = NULL;
|
||||||
size_t value_size;
|
size_t value_size;
|
||||||
bool plain = vshCommandOptBool(cmd, "plain");
|
bool plain = vshCommandOptBool(cmd, "plain");
|
||||||
@ -320,9 +319,10 @@ cmdSecretGetValue(vshControl *ctl, const vshCmd *cmd)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
base64 = g_base64_encode(value, value_size);
|
g_autofree char *base64 = g_base64_encode(value, value_size);
|
||||||
|
|
||||||
vshPrint(ctl, "%s", base64);
|
vshPrint(ctl, "%s", base64);
|
||||||
|
virSecureEraseString(base64);
|
||||||
}
|
}
|
||||||
|
|
||||||
virSecureErase(value, value_size);
|
virSecureErase(value, value_size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user