3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

netconfig: fix freeing invalid pointer

If l_rtnl_ifaddr4_extract does not set the values they would
get freed. Instead initialize to NULL so the cleanup free is
a no op.
This commit is contained in:
James Prestwood 2020-11-23 15:05:54 -08:00 committed by Denis Kenzior
parent ebc42ccecf
commit ccf265b943

View File

@ -441,9 +441,9 @@ static void netconfig_ifaddr_added(struct netconfig *netconfig,
const struct ifaddrmsg *ifa,
uint32_t len)
{
L_AUTO_FREE_VAR(char *, label);
L_AUTO_FREE_VAR(char *, ip);
L_AUTO_FREE_VAR(char *, broadcast);
L_AUTO_FREE_VAR(char *, label) = NULL;
L_AUTO_FREE_VAR(char *, ip) = NULL;
L_AUTO_FREE_VAR(char *, broadcast) = NULL;
l_rtnl_ifaddr4_extract(ifa, len, &label, &ip, &broadcast);
l_debug("%s: ifaddr %s/%u broadcast %s", label,