nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 41ad376b701bb6f2e484cbf17294aa8b31c8f56f
parent 1349c1d02c866eb478e2549a5cfc1b61a57b1583
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Fri, 22 Jul 2016 15:30:09 +0200

chars: plug a gushing memory leak

Diffstat:
Msrc/chars.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/chars.c b/src/chars.c @@ -197,12 +197,15 @@ bool is_word_mbchar(const char *c, bool allow_punct) return TRUE; if (word_chars != NULL && *word_chars != '\0') { + bool wordforming; char *symbol = charalloc(MB_CUR_MAX + 1); int symlen = parse_mbchar(c, symbol, NULL); symbol[symlen] = '\0'; + wordforming = (strstr(word_chars, symbol) != NULL); + free(symbol); - return (strstr(word_chars, symbol) != NULL); + return wordforming; } return (allow_punct && is_punct_mbchar(c));