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:
Anna Schumaker 2015-11-10 10:54:17 -05:00
parent 461cbdb9c3
commit 7865557fd5
1 changed files with 1 additions and 1 deletions

View File

@ -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)