[devhelp/gnome-2-28] Fix leak in view_setup_fonts()



commit b7a213058a668de617d84e3ced28ea907b54069b
Author: Jonathon Jongsma <jonathon quotidian org>
Date:   Tue Sep 29 15:06:49 2009 -0500

    Fix leak in view_setup_fonts()
    
    The following two valgrind reports should be fixed by this patch:
    
    ==17510== 12 bytes in 1 blocks are definitely lost in loss record 664 of 9,665
    ==17510==    at 0x4C221A7: malloc (vg_replace_malloc.c:195)
    ==17510==    by 0x7BAC232: g_malloc (gmem.c:131)
    ==17510==    by 0x7BC3CFD: g_strdup (gstrfuncs.c:102)
    ==17510==    by 0x5044E96: split_font_string (dh-util.c:575)
    ==17510==    by 0x5044EE7: dh_util_font_get_fixed (dh-util.c:647)
    ==17510==    by 0x5045066: view_setup_fonts (dh-util.c:683)
    ==17510==    by 0x504627F: window_open_new_tab (dh-window.c:1194)
    ==17510==    by 0x5047BCC: dh_window_new (dh-window.c:902)
    ==17510==    by 0x504067D: dh_base_new_window (dh-base.c:441)
    ==17510==    by 0x4020E7: main (dh-main.c:286)
    
    and
    
    ==17510== 11 bytes in 1 blocks are definitely lost in loss record 583 of 9,665
    ==17510==    at 0x4C221A7: malloc (vg_replace_malloc.c:195)
    ==17510==    by 0x7BAC232: g_malloc (gmem.c:131)
    ==17510==    by 0x7BC3CFD: g_strdup (gstrfuncs.c:102)
    ==17510==    by 0x5044E96: split_font_string (dh-util.c:575)
    ==17510==    by 0x5044F97: dh_util_font_get_variable (dh-util.c:615)
    ==17510==    by 0x5045053: view_setup_fonts (dh-util.c:681)
    ==17510==    by 0x504627F: window_open_new_tab (dh-window.c:1194)
    ==17510==    by 0x5047BCC: dh_window_new (dh-window.c:902)
    ==17510==    by 0x504067D: dh_base_new_window (dh-base.c:441)
    ==17510==    by 0x4020E7: main (dh-main.c:286)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=596808
    (cherry picked from commit 993c952d0befb2e87bec9c55ae16c5a2ddf0b2a5)

 src/dh-util.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/dh-util.c b/src/dh-util.c
index d1f2653..7ef964c 100644
--- a/src/dh-util.c
+++ b/src/dh-util.c
@@ -690,6 +690,9 @@ view_setup_fonts (WebKitWebView *view)
                       "serif-font-family", variable_name,
                       "default-font-size", (guint) variable_size,
                       NULL);
+
+        g_free (variable_name);
+        g_free (fixed_name);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]