diff options
author | Thomas Haller <thaller@redhat.com> | 2020-08-28 14:28:07 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-08-28 14:28:56 +0200 |
commit | a75dfc73e2eec7a1106d835090d9902097e86ea7 (patch) | |
tree | 66c061c70c20dfd082d98bea4198c8a7098e9c9a | |
parent | 12e8557476174b8aeefba1e0a189b4d4896a8374 (diff) | |
download | NetworkManager-a75dfc73e2eec7a1106d835090d9902097e86ea7.tar.gz |
dhcp: workaround "maybe-uninitialized" in dhcp_event_cb()
With LTO we get a compiler warning:
src/dhcp/nm-dhcp-systemd.c: In function dhcp_event_cb:
src/dhcp/nm-dhcp-systemd.c:554: error: lease may be used uninitialized in this function [-Werror=maybe-uninitialized]
554 | r = sd_dhcp_lease_get_server_identifier (lease, &addr);
|
src/dhcp/nm-dhcp-systemd.c:528: note: lease was declared here
528 | sd_dhcp_lease *lease;
|
Fixes: 7f217d0345f5 ('core: honor the ipv4.dhcp-reject-servers property')
-rw-r--r-- | src/dhcp/nm-dhcp-systemd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dhcp/nm-dhcp-systemd.c b/src/dhcp/nm-dhcp-systemd.c index b657a42118..cd2a00c713 100644 --- a/src/dhcp/nm-dhcp-systemd.c +++ b/src/dhcp/nm-dhcp-systemd.c @@ -525,7 +525,7 @@ dhcp_event_cb (sd_dhcp_client *client, int event, gpointer user_data) NMDhcpSystemd *self = NM_DHCP_SYSTEMD (user_data); NMDhcpSystemdPrivate *priv = NM_DHCP_SYSTEMD_GET_PRIVATE (self); char addr_str[INET_ADDRSTRLEN]; - sd_dhcp_lease *lease; + sd_dhcp_lease *lease = NULL; struct in_addr addr; int r; |