changeset 11240:2ab2de8add8b

[gaim-migrate @ 13399] Fix a win32 clipboard memory leak. Untested, holler at me if this is broken. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 12 Aug 2005 04:02:45 +0000
parents 657aa9a3a7b0
children 66f872f30e40
files src/gtkimhtml.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkimhtml.c	Fri Aug 12 01:58:52 2005 +0000
+++ b/src/gtkimhtml.c	Fri Aug 12 04:02:45 2005 +0000
@@ -210,8 +210,9 @@
 static gchar *
 clipboard_html_to_win32(char *html) {
 	int length;
+	GString *clipboard;
+	gchar *tmp;
 	gchar *ret;
-	GString *clipboard;
 
 	if (html == NULL)
 		return NULL;
@@ -219,9 +220,13 @@
 	length = strlen(html);
 	clipboard = g_string_new ("Version:1.0\r\n");
 	g_string_append(clipboard, "StartHTML:0000000105\r\n");
-	g_string_append(clipboard, g_strdup_printf("EndHTML:%010d\r\n", 147 + length));
+	tmp = g_strdup_printf("EndHTML:%010d\r\n", 147 + length);
+	g_string_append(clipboard, tmp);
+	g_free(tmp);
 	g_string_append(clipboard, "StartFragment:0000000127\r\n");
-	g_string_append(clipboard, g_strdup_printf("EndFragment:%010d\r\n", 127 + length));
+	tmp = g_strdup_printf("EndFragment:%010d\r\n", 127 + length);
+	g_string_append(clipboard, tmp);
+	g_free(tmp);
 	g_string_append(clipboard, "<!--StartFragment-->\r\n");
 	g_string_append(clipboard, html);
 	g_string_append(clipboard, "\r\n<!--EndFragment-->");