3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 13:59:24 +01:00

main: Fix freeing invalid pointer

This commit is contained in:
Tim Kourt 2020-04-10 11:09:42 -07:00 committed by Denis Kenzior
parent 1dfc28d21a
commit 104e6898ca

View File

@ -374,6 +374,7 @@ int main(int argc, char *argv[])
struct l_dbus *dbus; struct l_dbus *dbus;
const char *config_dir; const char *config_dir;
char **config_dirs; char **config_dirs;
int i;
for (;;) { for (;;) {
int opt; int opt;
@ -456,9 +457,9 @@ int main(int argc, char *argv[])
config_dirs = l_strsplit(config_dir, ':'); config_dirs = l_strsplit(config_dir, ':');
for (; *config_dirs; config_dirs++) { for (i = 0; config_dirs[i]; i++) {
L_AUTO_FREE_VAR(char *, path) = L_AUTO_FREE_VAR(char *, path) =
l_strdup_printf("%s/%s", *config_dirs, "main.conf"); l_strdup_printf("%s/%s", config_dirs[i], "main.conf");
if (!l_settings_load_from_file(iwd_config, path)) if (!l_settings_load_from_file(iwd_config, path))
continue; continue;