Blame SOURCES/0002-utils-fix-maybe-uninitialized-in-nm-udev-utils.c.patch

fc9aca
From 1ea56b82121d3f024859da41337cf2406e7f2e61 Mon Sep 17 00:00:00 2001
fc9aca
From: Thomas Haller <thaller@redhat.com>
fc9aca
Date: Wed, 10 May 2017 15:31:15 +0200
fc9aca
Subject: [PATCH 1/1] utils: fix maybe-uninitialized in "nm-udev-utils.c"
fc9aca
MIME-Version: 1.0
fc9aca
Content-Type: text/plain; charset=UTF-8
fc9aca
Content-Transfer-Encoding: 8bit
fc9aca
fc9aca
      CC       shared/nm-utils/libnm_core_libnm_core_la-nm-udev-utils.lo
fc9aca
    In file included from ./shared/nm-utils/nm-glib.h:27:0,
fc9aca
                     from ./shared/nm-utils/nm-macros-internal.h:29,
fc9aca
                     from ./shared/nm-default.h:178,
fc9aca
                     from shared/nm-utils/nm-udev-utils.c:21:
fc9aca
    shared/nm-utils/nm-udev-utils.c: In function ‘nm_udev_client_enumerate_new’:
fc9aca
    ./shared/nm-utils/gsystem-local-alloc.h:53:50: error: ‘to_free’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
fc9aca
     GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
fc9aca
                                                      ^~~~~~
fc9aca
    shared/nm-utils/nm-udev-utils.c:147:18: note: ‘to_free’ was declared here
fc9aca
        gs_free char *to_free;
fc9aca
                      ^~~~~~~
fc9aca
    In file included from ./shared/nm-utils/nm-glib.h:27:0,
fc9aca
                     from ./shared/nm-utils/nm-macros-internal.h:29,
fc9aca
                     from ./shared/nm-default.h:178,
fc9aca
                     from shared/nm-utils/nm-udev-utils.c:21:
fc9aca
    shared/nm-utils/nm-udev-utils.c: In function ‘nm_udev_client_new’:
fc9aca
    ./shared/nm-utils/gsystem-local-alloc.h:53:50: error: ‘to_free’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
fc9aca
     GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
fc9aca
                                                      ^~~~~~
fc9aca
    shared/nm-utils/nm-udev-utils.c:243:20: note: ‘to_free’ was declared here
fc9aca
          gs_free char *to_free;
fc9aca
                        ^~~~~~~
fc9aca
fc9aca
Fixes: e32839838e5ea74ba490cf912e20939afa0e4f40
fc9aca
(cherry picked from commit 0893c3756ef898f8fe6e2367d5167a345299dcd4)
fc9aca
(cherry picked from commit e2902f61a4462e6d197a20bf3d0ab996b64305b1)
fc9aca
---
fc9aca
 shared/nm-utils/nm-udev-utils.c | 4 ++--
fc9aca
 1 file changed, 2 insertions(+), 2 deletions(-)
fc9aca
fc9aca
diff --git a/shared/nm-utils/nm-udev-utils.c b/shared/nm-utils/nm-udev-utils.c
fc9aca
index 5552d59..bf0ad5b 100644
fc9aca
--- a/shared/nm-utils/nm-udev-utils.c
fc9aca
+++ b/shared/nm-utils/nm-udev-utils.c
fc9aca
@@ -144,7 +144,7 @@ nm_udev_utils_enumerate (struct udev *uclient,
fc9aca
 		for (n = 0; subsystems[n]; n++) {
fc9aca
 			const char *subsystem;
fc9aca
 			const char *devtype;
fc9aca
-			gs_free char *to_free;
fc9aca
+			gs_free char *to_free = NULL;
fc9aca
 
fc9aca
 			_subsystem_split (subsystems[n], &subsystem, &devtype, &to_free);
fc9aca
 
fc9aca
@@ -240,7 +240,7 @@ nm_udev_client_new (const char *const*subsystems,
fc9aca
 			/* install subsystem filters to only wake up for certain events */
fc9aca
 			for (n = 0; self->subsystems[n]; n++) {
fc9aca
 				if (self->monitor) {
fc9aca
-					gs_free char *to_free;
fc9aca
+					gs_free char *to_free = NULL;
fc9aca
 					const char *subsystem;
fc9aca
 					const char *devtype;
fc9aca
 
fc9aca
-- 
fc9aca
2.9.3
fc9aca