--- gtk/compose.c 2006-12-22 05:32:35.000000000 +0100 +++ gtk/compose.c 2007-06-28 20:00:20.000000000 +0200 @@ -440,7 +440,7 @@ return 0; len = strlen(mb); strlcpy(buf, mb, MB_LEN_MAX + 1); - free(mb); + g_free(mb); return len; } @@ -611,7 +611,12 @@ goto error; } - rhs_string_utf8 = g_locale_to_utf8(rhs_string_mb, -1, NULL, NULL, NULL); + { + char *result; + result = g_locale_to_utf8(rhs_string_mb, -1, NULL, NULL, NULL); + rhs_string_utf8 = strdup(result); + g_free(result); + } for (i = 0; i < n; i++) { for (p = *top; p; p = p->next) { --- gtk/gtk-im-uim.c 2006-12-22 05:32:35.000000000 +0100 +++ gtk/gtk-im-uim.c 2007-06-28 16:48:56.000000000 +0200 @@ -259,7 +259,7 @@ } } - str = (char *)realloc(str, strlen(str) + strlen(segment_str) + 1); + str = (char *)g_realloc(str, strlen(str) + strlen(segment_str) + 1); strcat(str, segment_str); return str; @@ -565,8 +565,8 @@ int i; for (i = 0; i < uic->nr_psegs; i++) - free(uic->pseg[i].str); - free(uic->pseg); + g_free(uic->pseg[i].str); + g_free(uic->pseg); uic->pseg = NULL; uic->nr_psegs = 0; @@ -582,7 +582,7 @@ && !(attr & (UPreeditAttr_Cursor | UPreeditAttr_Separator))) return; - uic->pseg = realloc(uic->pseg, + uic->pseg = g_realloc(uic->pseg, sizeof(struct preedit_segment) * (uic->nr_psegs + 1)); uic->pseg[uic->nr_psegs].str = g_strdup(str); uic->pseg[uic->nr_psegs].attr = attr; @@ -1138,7 +1138,7 @@ if (str) *str = tmp; else - free(tmp); + g_free(tmp); } static void