Mercurial > pidgin
comparison src/gtkimhtml.c @ 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 | 7d5e8bed8018 |
children | 477e5cca8287 |
comparison
equal
deleted
inserted
replaced
11239:657aa9a3a7b0 | 11240:2ab2de8add8b |
---|---|
208 } | 208 } |
209 | 209 |
210 static gchar * | 210 static gchar * |
211 clipboard_html_to_win32(char *html) { | 211 clipboard_html_to_win32(char *html) { |
212 int length; | 212 int length; |
213 GString *clipboard; | |
214 gchar *tmp; | |
213 gchar *ret; | 215 gchar *ret; |
214 GString *clipboard; | |
215 | 216 |
216 if (html == NULL) | 217 if (html == NULL) |
217 return NULL; | 218 return NULL; |
218 | 219 |
219 length = strlen(html); | 220 length = strlen(html); |
220 clipboard = g_string_new ("Version:1.0\r\n"); | 221 clipboard = g_string_new ("Version:1.0\r\n"); |
221 g_string_append(clipboard, "StartHTML:0000000105\r\n"); | 222 g_string_append(clipboard, "StartHTML:0000000105\r\n"); |
222 g_string_append(clipboard, g_strdup_printf("EndHTML:%010d\r\n", 147 + length)); | 223 tmp = g_strdup_printf("EndHTML:%010d\r\n", 147 + length); |
224 g_string_append(clipboard, tmp); | |
225 g_free(tmp); | |
223 g_string_append(clipboard, "StartFragment:0000000127\r\n"); | 226 g_string_append(clipboard, "StartFragment:0000000127\r\n"); |
224 g_string_append(clipboard, g_strdup_printf("EndFragment:%010d\r\n", 127 + length)); | 227 tmp = g_strdup_printf("EndFragment:%010d\r\n", 127 + length); |
228 g_string_append(clipboard, tmp); | |
229 g_free(tmp); | |
225 g_string_append(clipboard, "<!--StartFragment-->\r\n"); | 230 g_string_append(clipboard, "<!--StartFragment-->\r\n"); |
226 g_string_append(clipboard, html); | 231 g_string_append(clipboard, html); |
227 g_string_append(clipboard, "\r\n<!--EndFragment-->"); | 232 g_string_append(clipboard, "\r\n<!--EndFragment-->"); |
228 ret = clipboard->str; | 233 ret = clipboard->str; |
229 g_string_free(clipboard, FALSE); | 234 g_string_free(clipboard, FALSE); |