diff options
author | lbonn <[email protected]> | 2019-09-07 23:41:33 +0200 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2019-11-01 12:18:09 -0400 |
commit | a6307aed0089a35b5594f910c9604262b46832e6 (patch) | |
tree | 4cab6ca6b96b6cabfe224996fc3e8747e4e51272 /sway/config.c | |
parent | 32caabc7a172552a35358d7cde89790ebfa96d48 (diff) |
Fix various memory leaks
Found with clang-tidy
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; } |