diff options
author | Thomas Haller <thaller@redhat.com> | 2017-05-10 15:31:15 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-05-10 15:34:23 +0200 |
commit | 0893c3756ef898f8fe6e2367d5167a345299dcd4 (patch) | |
tree | a0581d93a72079076454c15a31ac4f09f28c288b | |
parent | 5dd335584c1be56a94c9cba6c04f6268a9f91439 (diff) | |
download | NetworkManager-0893c3756ef898f8fe6e2367d5167a345299dcd4.tar.gz |
utils: fix maybe-uninitialized in "nm-udev-utils.c"
CC shared/nm-utils/libnm_core_libnm_core_la-nm-udev-utils.lo
In file included from ./shared/nm-utils/nm-glib.h:27:0,
from ./shared/nm-utils/nm-macros-internal.h:29,
from ./shared/nm-default.h:178,
from shared/nm-utils/nm-udev-utils.c:21:
shared/nm-utils/nm-udev-utils.c: In function ‘nm_udev_client_enumerate_new’:
./shared/nm-utils/gsystem-local-alloc.h:53:50: error: ‘to_free’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
^~~~~~
shared/nm-utils/nm-udev-utils.c:147:18: note: ‘to_free’ was declared here
gs_free char *to_free;
^~~~~~~
In file included from ./shared/nm-utils/nm-glib.h:27:0,
from ./shared/nm-utils/nm-macros-internal.h:29,
from ./shared/nm-default.h:178,
from shared/nm-utils/nm-udev-utils.c:21:
shared/nm-utils/nm-udev-utils.c: In function ‘nm_udev_client_new’:
./shared/nm-utils/gsystem-local-alloc.h:53:50: error: ‘to_free’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free)
^~~~~~
shared/nm-utils/nm-udev-utils.c:243:20: note: ‘to_free’ was declared here
gs_free char *to_free;
^~~~~~~
Fixes: e32839838e5ea74ba490cf912e20939afa0e4f40
-rw-r--r-- | shared/nm-utils/nm-udev-utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shared/nm-utils/nm-udev-utils.c b/shared/nm-utils/nm-udev-utils.c index 5552d592db..bf0ad5b931 100644 --- a/shared/nm-utils/nm-udev-utils.c +++ b/shared/nm-utils/nm-udev-utils.c @@ -144,7 +144,7 @@ nm_udev_utils_enumerate (struct udev *uclient, for (n = 0; subsystems[n]; n++) { const char *subsystem; const char *devtype; - gs_free char *to_free; + gs_free char *to_free = NULL; _subsystem_split (subsystems[n], &subsystem, &devtype, &to_free); @@ -240,7 +240,7 @@ nm_udev_client_new (const char *const*subsystems, /* install subsystem filters to only wake up for certain events */ for (n = 0; self->subsystems[n]; n++) { if (self->monitor) { - gs_free char *to_free; + gs_free char *to_free = NULL; const char *subsystem; const char *devtype; |