Signed-off-by: Ján Tomko <jto...@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

Reply via email to