fix: when set, free oldline after reading line
This commit is contained in:
@@ -457,6 +457,12 @@ int main(int argc, char** argv) {
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// oldline is only valid while reading
|
||||||
|
if (oldline != NULL) {
|
||||||
|
free(oldline);
|
||||||
|
oldline = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
putc('\n', stdout);
|
putc('\n', stdout);
|
||||||
|
|
||||||
tcsetattr(fileno(stdin), 0, &orig_term);
|
tcsetattr(fileno(stdin), 0, &orig_term);
|
||||||
|
|||||||
Reference in New Issue
Block a user