mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-24 20:40:06 +01:00
ifcfg-rh: fix crash for reading invalid bridge configuration
Error found by coverity. https://bugzilla.gnome.org/show_bug.cgi?id=728320 Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
73d4edb0b7
commit
628e774ba8
1 changed files with 7 additions and 8 deletions
|
|
@ -215,17 +215,16 @@ make_connection_setting (const char *file,
|
|||
|
||||
value = svGetValue (ifcfg, "BRIDGE", FALSE);
|
||||
if (value) {
|
||||
const char *bridge;
|
||||
const char *old_value;
|
||||
|
||||
if ((bridge = nm_setting_connection_get_master (s_con))) {
|
||||
if ((old_value = nm_setting_connection_get_master (s_con))) {
|
||||
PARSE_WARNING ("Already configured as slave of %s. Ignoring BRIDGE=\"%s\"",
|
||||
bridge, value);
|
||||
g_free (value);
|
||||
old_value, value);
|
||||
} else {
|
||||
g_object_set (s_con, NM_SETTING_CONNECTION_MASTER, value, NULL);
|
||||
g_object_set (s_con, NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME, NULL);
|
||||
}
|
||||
|
||||
g_object_set (s_con, NM_SETTING_CONNECTION_MASTER, value, NULL);
|
||||
g_object_set (s_con, NM_SETTING_CONNECTION_SLAVE_TYPE,
|
||||
NM_SETTING_BRIDGE_SETTING_NAME, NULL);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue