[devhelp] Fix a couple large leaks in DhBase



commit c97e4c5b9cfd2553ba4e5af83bb6f719deabfcb9
Author: Jonathon Jongsma <jonathon quotidian org>
Date:   Tue Sep 29 15:32:32 2009 -0500

    Fix a couple large leaks in DhBase
    
    The following leaks should be fixed by this patch:
    
    ==17510== 8,275 (72 direct, 8,203 indirect) bytes in 1 blocks are definitely lost in loss record 9,606 of 9,665
    ==17510==    at 0x4C221A7: malloc (vg_replace_malloc.c:195)
    ==17510==    by 0x7BAC232: g_malloc (gmem.c:131)
    ==17510==    by 0x7BC20A7: g_slice_alloc (gslice.c:824)
    ==17510==    by 0x7B95B92: g_hash_table_new_full (ghash.c:512)
    ==17510==    by 0x5040BE7: dh_base_init (dh-base.c:104)
    ==17510==    by 0xFA39A84: g_type_create_instance (gtype.c:1674)
    ==17510==    by 0xFA1E7EA: g_object_constructor (gobject.c:1338)
    ==17510==    by 0xFA1EE5C: g_object_newv (gobject.c:1215)
    ==17510==    by 0xFA1F9A6: g_object_new_valist (gobject.c:1278)
    ==17510==    by 0xFA1FAEB: g_object_new (gobject.c:1060)
    ==17510==    by 0x50409D3: dh_base_get (dh-base.c:413)
    ==17510==    by 0x402004: main (dh-main.c:280)
    
    and
    
    ==17510== 136,240 (40 direct, 136,200 indirect) bytes in 1 blocks are definitely lost in loss record 9,654 of 9,665
    ==17510==    at 0x4C221A7: malloc (vg_replace_malloc.c:195)
    ==17510==    by 0x7BAC232: g_malloc (gmem.c:131)
    ==17510==    by 0x7BC20A7: g_slice_alloc (gslice.c:824)
    ==17510==    by 0x7BC23D5: g_slice_alloc0 (gslice.c:833)
    ==17510==    by 0x7BAFBFD: g_node_new (gnode.c:58)
    ==17510==    by 0x5040BC6: dh_base_init (dh-base.c:103)
    ==17510==    by 0xFA39A84: g_type_create_instance (gtype.c:1674)
    ==17510==    by 0xFA1E7EA: g_object_constructor (gobject.c:1338)
    ==17510==    by 0xFA1EE5C: g_object_newv (gobject.c:1215)
    ==17510==    by 0xFA1F9A6: g_object_new_valist (gobject.c:1278)
    ==17510==    by 0xFA1FAEB: g_object_new (gobject.c:1060)
    ==17510==    by 0x50409D3: dh_base_get (dh-base.c:413)
    ==17510==    by 0x402004: main (dh-main.c:280)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=596808

 src/dh-base.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/dh-base.c b/src/dh-base.c
index f539a30..ca33a2c 100644
--- a/src/dh-base.c
+++ b/src/dh-base.c
@@ -74,6 +74,8 @@ base_finalize (GObject *object)
         priv = GET_PRIVATE (object);
 
         /* FIXME: Free things... */
+        g_hash_table_destroy (priv->books);
+        g_node_destroy (priv->book_tree);
 
         G_OBJECT_CLASS (dh_base_parent_class)->finalize (object);
 }



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