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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user