mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 02:00:15 +01:00
core: fix returning invalid pointer from nm_netns_l3cfg_get()
The code isn't actually used outside of tests.
Fixes: 15f5d10352 ('l3cfg: add nm_netns_get_l3cfg() accessor')
This commit is contained in:
parent
135bbcc0e4
commit
e3d3b001e0
1 changed files with 4 additions and 1 deletions
|
|
@ -129,13 +129,16 @@ NML3Cfg *
|
|||
nm_netns_l3cfg_get(NMNetns *self, int ifindex)
|
||||
{
|
||||
NMNetnsPrivate *priv;
|
||||
L3CfgData *l3cfg_data;
|
||||
|
||||
g_return_val_if_fail(NM_IS_NETNS(self), NULL);
|
||||
g_return_val_if_fail(ifindex > 0, NULL);
|
||||
|
||||
priv = NM_NETNS_GET_PRIVATE(self);
|
||||
|
||||
return g_hash_table_lookup(priv->l3cfgs, &ifindex);
|
||||
l3cfg_data = g_hash_table_lookup(priv->l3cfgs, &ifindex);
|
||||
|
||||
return l3cfg_data ? l3cfg_data->l3cfg : NULL;
|
||||
}
|
||||
|
||||
NML3Cfg *
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue