Blame SOURCES/0012-Fix-maybe-uninitialized-warning.patch

9067cc
From ee9f80190d4c458a09309fbd9a88d2756dc2d3fa Mon Sep 17 00:00:00 2001
9067cc
From: Javier Martinez Canillas <javierm@redhat.com>
9067cc
Date: Mon, 10 Feb 2020 20:13:13 +0100
9067cc
Subject: [PATCH] Fix maybe-uninitialized warning
9067cc
9067cc
GCC gives the following compile warning:
9067cc
9067cc
grubby.c: In function 'suseGrubConfGetBoot':
9067cc
grubby.c:2770:5: error: 'grubDevice' may be used uninitialized in this function [-Werror=maybe-uninitialized]
9067cc
 2770 |     free(grubDevice);
9067cc
      |     ^~~~~~~~~~~~~~~~
9067cc
cc1: all warnings being treated as errors
9067cc
make: *** [Makefile:38: grubby.o] Error 1
9067cc
9067cc
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
9067cc
---
9067cc
 grubby.c | 2 +-
9067cc
 1 file changed, 1 insertion(+), 1 deletion(-)
9067cc
9067cc
diff --git a/grubby.c b/grubby.c
9067cc
index 0c0f67a0ae5..779c25a2bf9 100644
9067cc
--- a/grubby.c
9067cc
+++ b/grubby.c
9067cc
@@ -2755,7 +2755,7 @@ int grubGetBootFromDeviceMap(const char * device,
9067cc
 }
9067cc
 
9067cc
 int suseGrubConfGetBoot(const char * path, char ** bootPtr) {
9067cc
-    char * grubDevice;
9067cc
+    char * grubDevice = NULL;
9067cc
 
9067cc
     if (suseGrubConfGetInstallDevice(path, &grubDevice))
9067cc
 	dbgPrintf("error looking for grub installation device\n");
9067cc
-- 
9067cc
2.24.1
9067cc