core/string: Realloc strings before returning
g_strchomp() modifies the string in place, but doesn't free up unused memory at the end of the original string. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
461cbdb9c3
commit
7865557fd5
|
@ -73,7 +73,7 @@ gchar *string_lowercase(const gchar *str)
|
|||
*j = '\0';
|
||||
|
||||
g_strchomp(res);
|
||||
return res;
|
||||
return g_realloc(res, strlen(res) + 1);
|
||||
}
|
||||
|
||||
int string_compare(const gchar *lhs, const gchar *rhs)
|
||||
|
|
Loading…
Reference in New Issue