From e7df811f100f74dc005efcd12818742f040cb940 Mon Sep 17 00:00:00 2001 From: lbonn Date: Fri, 6 Oct 2017 16:23:59 +0200 Subject: Security config: skip hidden files Also: fix a small memory leak --- sway/config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sway/config.c b/sway/config.c index 4cb080ab..5b2b6569 100644 --- a/sway/config.c +++ b/sway/config.c @@ -550,9 +550,12 @@ bool load_main_config(const char *file, bool is_active) { strcpy(_path, base); strcat(_path, ent->d_name); lstat(_path, &s); - if (S_ISREG(s.st_mode)) { + if (S_ISREG(s.st_mode) && ent->d_name[0] != '.') { list_add(secconfigs, _path); } + else { + free(_path); + } ent = readdir(dir); } closedir(dir); -- cgit v1.2.3