pidgin: a6270c00: Patch from Gaul to plug a small leak, wi...

sadrul at pidgin.im sadrul at pidgin.im
Thu Apr 17 13:01:11 EDT 2008


-----------------------------------------------------------------
Revision: a6270c0093cc57b6059401e4023a0ae6e7d8627f
Ancestor: 371b9fc5e0540b1a7ad069de7fc76ab60f7f17b7
Author: sadrul at pidgin.im
Date: 2008-04-17T16:59:31
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a6270c0093cc57b6059401e4023a0ae6e7d8627f

Modified files:
        pidgin/gtkimhtml.c

ChangeLog: 

Patch from Gaul to plug a small leak, with an additional fix to free
another returned value from gtk_imhtml_get_html_opt. Closes #5536.

-------------- next part --------------
============================================================
--- pidgin/gtkimhtml.c	959ec2b53eced31caf52d9381afcdbf0065bf3a9
+++ pidgin/gtkimhtml.c	68bfbe6c83a614dbd6f0c70f846849571c7dae1b
@@ -2697,8 +2697,11 @@ void gtk_imhtml_insert_html_at_iter(GtkI
 
 						if (sml)
 							font->sml = sml;
-						else if (oldfont && oldfont->sml)
-							font->sml = g_strdup(oldfont->sml);
+						else {
+							g_free(sml);
+							if (oldfont && oldfont->sml)
+								font->sml = g_strdup(oldfont->sml);
+						}
 
 						if (size && !(options & GTK_IMHTML_NO_SIZES) && (imhtml->format_functions & (GTK_IMHTML_GROW|GTK_IMHTML_SHRINK))) {
 							if (*size == '+') {
@@ -2750,7 +2753,7 @@ void gtk_imhtml_insert_html_at_iter(GtkI
 				case 46:	/* IMG (opt) */
 				case 59:	/* IMG */
 					{
-						const char *id;
+						char *id;
 
 						gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
 						ws[0] = '\0'; wpos = 0;
@@ -2762,6 +2765,7 @@ void gtk_imhtml_insert_html_at_iter(GtkI
 						if (!id)
 							break;
 						gtk_imhtml_insert_image_at_iter(imhtml, atoi(id), iter);
+						g_free(id);
 						break;
 					}
 				case 47:	/* P (opt) */


More information about the Commits mailing list