mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 12:40:16 +01:00
ifcfg-rh: close file descriptor only when necessary
If the file was read-only, we already closed it. This fixes the following valgrind warnings: Warning: invalid file descriptor -1 in syscall close()
This commit is contained in:
parent
efed5254cd
commit
174da8f922
1 changed files with 2 additions and 1 deletions
|
|
@ -1373,7 +1373,8 @@ svCloseFile (shvarFile *s)
|
|||
|
||||
g_return_if_fail (s != NULL);
|
||||
|
||||
nm_close (s->fd);
|
||||
if (s->fd >= 0)
|
||||
nm_close (s->fd);
|
||||
g_free (s->fileName);
|
||||
c_list_for_each_safe (current, safe, &s->lst_head)
|
||||
line_free (c_list_entry (current, shvarLine, lst));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue