mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-10 17:10:25 +01:00
libnm/team: fix crash with nm_setting_team_remove_runner_tx_hash_by_value() having no runner_tx_hash array
This commit is contained in:
parent
acf1cf61cf
commit
047adae242
1 changed files with 7 additions and 6 deletions
|
|
@ -929,13 +929,14 @@ nm_setting_team_remove_runner_tx_hash_by_value (NMSettingTeam *setting,
|
|||
|
||||
g_return_val_if_fail (NM_IS_SETTING_TEAM (setting), FALSE);
|
||||
g_return_val_if_fail (txhash != NULL, FALSE);
|
||||
g_return_val_if_fail (txhash[0] != '\0', FALSE);
|
||||
|
||||
for (i = 0; i < priv->runner_tx_hash->len; i++) {
|
||||
if (nm_streq (txhash, priv->runner_tx_hash->pdata[i])) {
|
||||
g_ptr_array_remove_index (priv->runner_tx_hash, i);
|
||||
_notify (setting, PROP_RUNNER_TX_HASH);
|
||||
return TRUE;
|
||||
if (priv->runner_tx_hash) {
|
||||
for (i = 0; i < priv->runner_tx_hash->len; i++) {
|
||||
if (nm_streq (txhash, priv->runner_tx_hash->pdata[i])) {
|
||||
g_ptr_array_remove_index (priv->runner_tx_hash, i);
|
||||
_notify (setting, PROP_RUNNER_TX_HASH);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue