per Itay Perl's patch with a few additions of mine, fix various minor

memory leaks


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3986 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2006-12-02 17:22:21 +00:00
parent 916c7c26bf
commit ad36bdc773
3 changed files with 12 additions and 0 deletions

View File

@ -12,9 +12,15 @@ CVS code -
consistency. (DLR) consistency. (DLR)
- Rename NANO_ALT_.* and NANO_.*ALTKEY to NANO_META_.* and - Rename NANO_ALT_.* and NANO_.*ALTKEY to NANO_META_.* and
NANO_.*METAKEY, for consistency. (DLR) NANO_.*METAKEY, for consistency. (DLR)
- text.c:
do_verbatim_input()
- Fix minor memory leak. (DLR)
- winio.c: - winio.c:
parse_kbinput() parse_kbinput()
- Add missing break. (DLR) - Add missing break. (DLR)
- Fix minor memory leak. (Itay Perl)
parse_verbatim_kbinput()
- Fix minor memory leak. (DLR)
edit_draw() edit_draw()
- Fix potential warnings when assigning -1 to paintlen by using - Fix potential warnings when assigning -1 to paintlen by using
if/else clauses instead of "?" operators. (DLR) if/else clauses instead of "?" operators. (DLR)

View File

@ -2446,6 +2446,8 @@ void do_verbatim_input(void)
output[i] = (char)kbinput[i]; output[i] = (char)kbinput[i];
output[i] = '\0'; output[i] = '\0';
free(kbinput);
do_output(output, kbinput_len, TRUE); do_output(output, kbinput_len, TRUE);
free(output); free(output);

View File

@ -663,6 +663,8 @@ int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key)
fprintf(stderr, "parse_kbinput(): kbinput = %d, meta_key = %s, func_key = %s, escapes = %d, byte_digits = %d, retval = %d\n", *kbinput, *meta_key ? "TRUE" : "FALSE", *func_key ? "TRUE" : "FALSE", escapes, byte_digits, retval); fprintf(stderr, "parse_kbinput(): kbinput = %d, meta_key = %s, func_key = %s, escapes = %d, byte_digits = %d, retval = %d\n", *kbinput, *meta_key ? "TRUE" : "FALSE", *func_key ? "TRUE" : "FALSE", escapes, byte_digits, retval);
#endif #endif
free(kbinput);
/* Return the result. */ /* Return the result. */
return retval; return retval;
} }
@ -1535,6 +1537,8 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
/* Put back the first keystroke. */ /* Put back the first keystroke. */
unget_input(kbinput, 1); unget_input(kbinput, 1);
free(kbinput);
/* Get the complete sequence, and save the characters in it as the /* Get the complete sequence, and save the characters in it as the
* result. */ * result. */
*kbinput_len = get_key_buffer_len(); *kbinput_len = get_key_buffer_len();