[libvirt PATCH 3/5++] fixup: vshInitDebug

Ján Tomko jtomko at redhat.com
Wed Aug 11 07:40:13 UTC 2021


Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 tools/vsh.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index 1f384d4ea6..f9600bafba 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -2915,10 +2915,9 @@ static int
 vshInitDebug(vshControl *ctl)
 {
     const char *debugEnv;
-    g_autofree char *env = NULL;
 
     if (ctl->debug == VSH_DEBUG_DEFAULT) {
-        env = g_strdup_printf("%s_DEBUG", ctl->env_prefix);
+        g_autofree char *env = g_strdup_printf("%s_DEBUG", ctl->env_prefix);
 
         /* log level not set from commandline, check env variable */
         debugEnv = getenv(env);
@@ -2935,7 +2934,7 @@ vshInitDebug(vshControl *ctl)
     }
 
     if (ctl->logfile == NULL) {
-        env = g_strdup_printf("%s_LOG_FILE", ctl->env_prefix);
+        g_autofree char *env = g_strdup_printf("%s_LOG_FILE", ctl->env_prefix);
 
         /* log file not set from cmdline */
         debugEnv = getenv(env);
-- 
2.31.1




More information about the libvir-list mailing list