From 7c0443fb7301afaa08132a240490de1d1414e8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 11 Aug 2021 16:16:39 +0200 Subject: [PATCH] tools: virsh: cmdDominfo: rename 'ostype' variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use 'ostype' instead of generic 'str', to discourage reuse. Also mark it as autofree. Signed-off-by: Ján Tomko Reviewed-by: Martin Kletzander --- tools/virsh-domain-monitor.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 55c8dcf118..365c84fb5b 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -1276,7 +1276,8 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) bool ret = true; int autostart; unsigned int id; - char *str, uuid[VIR_UUID_STRING_BUFLEN]; + char uuid[VIR_UUID_STRING_BUFLEN]; + g_autofree char *ostype = NULL; int has_managed_save = 0; virshControl *priv = ctl->privData; g_auto(GStrv) messages = NULL; @@ -1294,10 +1295,8 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) if (virDomainGetUUIDString(dom, &uuid[0]) == 0) vshPrint(ctl, "%-15s %s\n", _("UUID:"), uuid); - if ((str = virDomainGetOSType(dom))) { - vshPrint(ctl, "%-15s %s\n", _("OS Type:"), str); - VIR_FREE(str); - } + if ((ostype = virDomainGetOSType(dom))) + vshPrint(ctl, "%-15s %s\n", _("OS Type:"), ostype); if (virDomainGetInfo(dom, &info) == 0) { vshPrint(ctl, "%-15s %s\n", _("State:"),