fix: when set, free oldline after reading line

This commit is contained in:
2026-10-13 20:43:44 +02:00
parent 37aab9b79b
commit c8b5621df1

View File

@@ -457,6 +457,12 @@ int main(int argc, char** argv) {
fflush(stdout);
}
// oldline is only valid while reading
if (oldline != NULL) {
free(oldline);
oldline = NULL;
}
putc('\n', stdout);
tcsetattr(fileno(stdin), 0, &orig_term);