diff options
author | Thomas Haller <thaller@redhat.com> | 2020-03-05 12:13:33 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-03-05 12:14:17 +0100 |
commit | 02a78b25ed11e4bdb80c1fc551b3b1e02a56036f (patch) | |
tree | fb2853544b6bb37bc59ae7588ac3f65047b0ff47 | |
parent | 6b1aaade74cf9d2cc5f02433cf34525b279011de (diff) | |
download | network-manager-applet-02a78b25ed11e4bdb80c1fc551b3b1e02a56036f.tar.gz |
applet: avoid compiler warning about uninitialized variable in info_dialog_add_page()
It's a false positive. Avoid it.
../src/applet-dialogs.c: In function applet_info_dialog_show:
../src/applet-dialogs.c:709:21: warning: ip6_config may be used uninitialized in this function [-Wmaybe-uninitialized]
709 | dns6 = def6_addr ? nm_ip_config_get_nameservers (ip6_config) : NULL;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/applet-dialogs.c:481:14: note: ip6_config was declared here
481 | NMIPConfig *ip6_config;
| ^~~~~~~~~~
-rw-r--r-- | src/applet-dialogs.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c index 88d32a64..b89d592b 100644 --- a/src/applet-dialogs.c +++ b/src/applet-dialogs.c @@ -478,7 +478,7 @@ info_dialog_add_page (GtkNotebook *notebook, char *str; const char *iface, *method = NULL; NMIPConfig *ip4_config; - NMIPConfig *ip6_config; + NMIPConfig *ip6_config = NULL; const char * const *dns; const char * const *dns6; NMIPAddress *def_addr = NULL; @@ -676,7 +676,6 @@ info_dialog_add_page (GtkNotebook *notebook, gtk_grid_attach (grid, create_info_group_label (_("IPv6"), FALSE), 0, row, 2, 1); row++; - addresses = NULL; ip6_config = nm_device_get_ip6_config (device); if (ip6_config) { addresses = nm_ip_config_get_addresses (ip6_config); |