And be a little more complete all the allocations that can be released are,
but there is a small catch. As mentioned in ncurses FAQ some leaks are
intentional, and that's the way they are.
Reference: https://invisible-island.net/ncurses/ncurses.faq.html#config_leaks
Reference: http://man7.org/linux/man-pages/man3/_nc_free_tinfo.3x.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
} else if (!ctl->clear_line_ends && (ctl->prompt_len > 0)) {
kill_line(ctl);
fflush(stdout);
- } else
- fputc('\n', stderr);
+ }
free(ctl->previous_search);
free(ctl->shell_line);
free(ctl->line_buf);
free(ctl->go_home);
+ if (ctl->current_file)
+ fclose(ctl->current_file);
+ del_curterm(cur_term);
_exit(EXIT_SUCCESS);
}
ctl.first_file = 0;
ctl.argv_position++;
}
- free(ctl.previous_search);
- free(initbuf);
- free(ctl.line_buf);
- reset_tty(&ctl);
- exit(EXIT_SUCCESS);
+ ctl.clear_line_ends = 0;
+ ctl.prompt_len = 0;
+ more_exit(&ctl);
}