mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0065-rescue-initialize-CLEANUP-pointer-variable.patch

a30de4
From d4d3e90ad9c9e144171ece825f60cb804449f835 Mon Sep 17 00:00:00 2001
a30de4
From: Pino Toscano <ptoscano@redhat.com>
a30de4
Date: Mon, 23 Oct 2017 17:44:23 +0200
a30de4
Subject: [PATCH] rescue: initialize CLEANUP pointer variable
a30de4
a30de4
This way it will not try to free uninitialized memory when going out of
a30de4
scope, and the inspector mode is not enabled.
a30de4
a30de4
Fixes commit 3637c42f4e521eb647d7dfae7f48eb1689d0af54.
a30de4
a30de4
(cherry picked from commit 0942241395b7faf02fd651a0d7b99628458febe4)
a30de4
---
a30de4
 rescue/escape.c | 2 +-
a30de4
 1 file changed, 1 insertion(+), 1 deletion(-)
a30de4
a30de4
diff --git a/rescue/escape.c b/rescue/escape.c
a30de4
index d6dc9d329..ae4919f69 100644
a30de4
--- a/rescue/escape.c
a30de4
+++ b/rescue/escape.c
a30de4
@@ -236,7 +236,7 @@ print_help (void)
a30de4
 static void
a30de4
 print_inspector (void)
a30de4
 {
a30de4
-  CLEANUP_FREE_STRING_LIST char **roots;
a30de4
+  CLEANUP_FREE_STRING_LIST char **roots = NULL;
a30de4
   size_t i;
a30de4
   const char *root;
a30de4
   char *str;
a30de4
-- 
a30de4
2.14.3
a30de4