diff options
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c index bb5b920b..afc60a42 100644 --- a/sway/config.c +++ b/sway/config.c @@ -687,8 +687,10 @@ static ssize_t getline_with_cont(char **lineptr, size_t *line_size, FILE *file, nread += next_nread - 2; if ((ssize_t) *line_size < nread + 1) { *line_size = nread + 1; + char *old_ptr = *lineptr; *lineptr = realloc(*lineptr, *line_size); if (!*lineptr) { + free(old_ptr); nread = -1; break; } |