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

Ján Tomko posted 1 patch 2 years, 8 months ago
Failed in applying to current master (apply log)
tools/vsh.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[libvirt PATCH 3/5++] fixup: vshInitDebug
Posted by Ján Tomko 2 years, 8 months ago
Signed-off-by: Ján Tomko <jtomko@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