Commit 41ad376b authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

chars: plug a gushing memory leak

No related merge requests found
Showing with 4 additions and 1 deletion
+4 -1
......@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment