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

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