mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 04:30:16 +01:00
l3cfg: allow %NULL argument for nm_l3_config_data_ref()
It's often convenient not to require the caller to check for %NULL. On the other hand, there are cases where having a %NULL instance is a bug, so gracefully accepting %NULL might hide bugs. Still, change it.
This commit is contained in:
parent
1b79b33206
commit
79913fb446
1 changed files with 4 additions and 2 deletions
|
|
@ -434,8 +434,10 @@ nm_l3_config_data_new (NMDedupMultiIndex *multi_idx,
|
|||
const NML3ConfigData *
|
||||
nm_l3_config_data_ref (const NML3ConfigData *self)
|
||||
{
|
||||
nm_assert (_NM_IS_L3_CONFIG_DATA (self, TRUE));
|
||||
((NML3ConfigData *) self)->ref_count++;
|
||||
if (self) {
|
||||
nm_assert (_NM_IS_L3_CONFIG_DATA (self, TRUE));
|
||||
((NML3ConfigData *) self)->ref_count++;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue