commit 559a4058cd1a863a55354824419bccbfd48a34fc parent 34ba0d7d4a896e343fb28ae029def481bc36dbec Author: James Prestwood <prestwoj@gmail.com> Date: Fri, 18 Mar 2022 09:44:20 -0700 wired: check return of l_settings_load_from_file Caught by static analysis Diffstat:
| M | wired/network.c | | | 5 | ++++- |
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/wired/network.c b/wired/network.c @@ -133,7 +133,10 @@ struct l_settings *network_lookup_security(const char *network) l_debug("Loading %s", path); conf = l_settings_new(); - l_settings_load_from_file(conf, path); + if (!l_settings_load_from_file(conf, path)) { + l_settings_free(conf); + conf = NULL; + } l_free(path);