mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-17 11:30:46 +02:00
ifcfg-rh: fix possible crash when route file creation fails
This commit is contained in:
parent
c32914fa3b
commit
6fe22d99f0
1 changed files with 3 additions and 2 deletions
|
|
@ -1316,13 +1316,14 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
|||
if (utils_has_route_file_new_syntax (route_path)) {
|
||||
shvarFile *routefile;
|
||||
|
||||
g_free (route_path);
|
||||
routefile = utils_get_route_ifcfg (ifcfg->fileName, TRUE);
|
||||
if (!routefile) {
|
||||
g_set_error (error, IFCFG_PLUGIN_ERROR, 0,
|
||||
"Could not create route file '%s'", routefile->fileName);
|
||||
"Could not create route file '%s'", route_path);
|
||||
g_free (route_path);
|
||||
goto out;
|
||||
}
|
||||
g_free (route_path);
|
||||
|
||||
num = nm_setting_ip4_config_get_num_routes (s_ip4);
|
||||
for (i = 0; i < 256; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue