comparison pidgin/gtkimhtml.c @ 22650:6827600df4fc

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.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 17 Apr 2008 16:59:31 +0000
parents 0de4b47d36ab
children 27c9c55499f8 1d012e75153f
comparison
equal deleted inserted replaced
22649:47731d2e9fe4 22650:6827600df4fc
2695 } else 2695 } else
2696 g_free(face); 2696 g_free(face);
2697 2697
2698 if (sml) 2698 if (sml)
2699 font->sml = sml; 2699 font->sml = sml;
2700 else if (oldfont && oldfont->sml) 2700 else {
2701 font->sml = g_strdup(oldfont->sml); 2701 g_free(sml);
2702 if (oldfont && oldfont->sml)
2703 font->sml = g_strdup(oldfont->sml);
2704 }
2702 2705
2703 if (size && !(options & GTK_IMHTML_NO_SIZES) && (imhtml->format_functions & (GTK_IMHTML_GROW|GTK_IMHTML_SHRINK))) { 2706 if (size && !(options & GTK_IMHTML_NO_SIZES) && (imhtml->format_functions & (GTK_IMHTML_GROW|GTK_IMHTML_SHRINK))) {
2704 if (*size == '+') { 2707 if (*size == '+') {
2705 sscanf (size + 1, "%hd", &font->size); 2708 sscanf (size + 1, "%hd", &font->size);
2706 font->size += 3; 2709 font->size += 3;
2748 } 2751 }
2749 break; 2752 break;
2750 case 46: /* IMG (opt) */ 2753 case 46: /* IMG (opt) */
2751 case 59: /* IMG */ 2754 case 59: /* IMG */
2752 { 2755 {
2753 const char *id; 2756 char *id;
2754 2757
2755 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2758 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2756 ws[0] = '\0'; wpos = 0; 2759 ws[0] = '\0'; wpos = 0;
2757 2760
2758 if (!(imhtml->format_functions & GTK_IMHTML_IMAGE)) 2761 if (!(imhtml->format_functions & GTK_IMHTML_IMAGE))
2760 2763
2761 id = gtk_imhtml_get_html_opt(tag, "ID="); 2764 id = gtk_imhtml_get_html_opt(tag, "ID=");
2762 if (!id) 2765 if (!id)
2763 break; 2766 break;
2764 gtk_imhtml_insert_image_at_iter(imhtml, atoi(id), iter); 2767 gtk_imhtml_insert_image_at_iter(imhtml, atoi(id), iter);
2768 g_free(id);
2765 break; 2769 break;
2766 } 2770 }
2767 case 47: /* P (opt) */ 2771 case 47: /* P (opt) */
2768 case 48: /* H3 (opt) */ 2772 case 48: /* H3 (opt) */
2769 case 49: /* HTML (opt) */ 2773 case 49: /* HTML (opt) */