aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/readline.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/readline.c b/common/readline.c
index 46b96623..1c396a90 100644
--- a/common/readline.c
+++ b/common/readline.c
@@ -56,6 +56,8 @@ char *peek_line(FILE *file, int line_offset, long *position) {
56 for (int i = 0; i <= line_offset; i++) { 56 for (int i = 0; i <= line_offset; i++) {
57 ssize_t read = getline(&line, &length, file); 57 ssize_t read = getline(&line, &length, file);
58 if (read < 0) { 58 if (read < 0) {
59 free(line);
60 line = NULL;
59 break; 61 break;
60 } 62 }
61 if (read > 0 && line[read - 1] == '\n') { 63 if (read > 0 && line[read - 1] == '\n') {