diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-12 14:22:50 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-12 14:22:50 -0400 |
| commit | d33ea41645432eb194ae1366247e337a7454f799 (patch) | |
| tree | d18dc7e387cf05318585befb976bc6ceae10375c | |
| parent | 6e5fb2ac4e5b780c74f310446ddd80d571170b0d (diff) | |
Fix memory leaks
| -rw-r--r-- | src/stdlib/files.c | 1 | ||||
| -rw-r--r-- | src/stdlib/paths.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/stdlib/files.c b/src/stdlib/files.c index 88d78676..b0545420 100644 --- a/src/stdlib/files.c +++ b/src/stdlib/files.c @@ -116,6 +116,7 @@ static file_t *_load_file(const char *filename, FILE *file) { ret->relative_filename = &filename[cwd_len + 1]; } } + if (line_buf != NULL) free(line_buf); return ret; } diff --git a/src/stdlib/paths.c b/src/stdlib/paths.c index 73f62975..810f98b1 100644 --- a/src/stdlib/paths.c +++ b/src/stdlib/paths.c @@ -662,6 +662,7 @@ static Text_t _next_line(FILE **f) { next_line:; ssize_t len = getline(&line, &size, *f); if (len <= 0) { + if (line != NULL) free(line); _line_reader_cleanup(f); return NONE_TEXT; } |
