mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-15 17:31:56 +00:00
fix: memory leak instroduced in #110
This commit is contained in:
committed by
Evgeniy Dushistov
parent
d5e1eb4d93
commit
849f0ed1ac
@@ -1047,10 +1047,11 @@ bool Libs::LookupSimilarWord(const gchar *sWord, std::set<glong> &iWordIndices,
|
||||
}
|
||||
// Upper the first character and lower others.
|
||||
if (!bFound) {
|
||||
const gchar *nextchar = g_utf8_next_char(sWord);
|
||||
gchar *firstchar = g_utf8_strup(sWord, nextchar - sWord);
|
||||
nextchar = g_utf8_strdown(nextchar, -1);
|
||||
casestr = g_strdup_printf("%s%s", firstchar, nextchar);
|
||||
const gchar *rest = g_utf8_next_char(sWord);
|
||||
gchar *firstchar = g_utf8_strup(sWord, rest - sWord);
|
||||
gchar *rest_lowercase = g_utf8_strdown(rest, -1);
|
||||
casestr = g_strdup_printf("%s%s", firstchar, rest_lowercase);
|
||||
g_free(rest_lowercase);
|
||||
g_free(firstchar);
|
||||
if (strcmp(casestr, sWord)) {
|
||||
if (oLib[iLib]->Lookup(casestr, iWordIndices))
|
||||
|
||||
Reference in New Issue
Block a user