diff --git a/ChangeLog b/ChangeLog index aa9b923616271eb7bedaa2053dea9abb33a5f677..749488542bca929165b03f58d69ac71952a375c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,9 +12,15 @@ CVS code - consistency. (DLR) - Rename NANO_ALT_.* and NANO_.*ALTKEY to NANO_META_.* and NANO_.*METAKEY, for consistency. (DLR) +- text.c: + do_verbatim_input() + - Fix minor memory leak. (DLR) - winio.c: parse_kbinput() - Add missing break. (DLR) + - Fix minor memory leak. (Itay Perl) + parse_verbatim_kbinput() + - Fix minor memory leak. (DLR) edit_draw() - Fix potential warnings when assigning -1 to paintlen by using if/else clauses instead of "?" operators. (DLR) diff --git a/src/text.c b/src/text.c index 48516f74a4bfcf577158d65f00aac7dac6e98544..11ae03414bcb9c7698b5d3f9e226bd40a79672c9 100644 --- a/src/text.c +++ b/src/text.c @@ -2446,6 +2446,8 @@ void do_verbatim_input(void) output[i] = (char)kbinput[i]; output[i] = '\0'; + free(kbinput); + do_output(output, kbinput_len, TRUE); free(output); diff --git a/src/winio.c b/src/winio.c index 716452459d90a6d5aa134dc2b2972aa15e436579..37d8b5748f0b7b74a8562eeb039669b8ce0aca44 100644 --- a/src/winio.c +++ b/src/winio.c @@ -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); #endif + free(kbinput); + /* Return the result. */ return retval; } @@ -1535,6 +1537,8 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len) /* Put back the first keystroke. */ unget_input(kbinput, 1); + free(kbinput); + /* Get the complete sequence, and save the characters in it as the * result. */ *kbinput_len = get_key_buffer_len();