aboutsummaryrefslogtreecommitdiff
path: root/swaynag/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaynag/config.c')
-rw-r--r--swaynag/config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/swaynag/config.c b/swaynag/config.c
index 60bda3e0..b4c22443 100644
--- a/swaynag/config.c
+++ b/swaynag/config.c
@@ -365,11 +365,12 @@ int swaynag_load_config(char *path, struct swaynag *swaynag, list_t *types) {
}
free(name);
} else {
- char flag[nread + 3];
+ char *flag = malloc(sizeof(char) * (nread + 3));
sprintf(flag, "--%s", line);
char *argv[] = {"swaynag", flag};
result = swaynag_parse_options(2, argv, swaynag, types, type,
NULL, NULL);
+ free(flag);
if (result != 0) {
break;
}