Fix type free memleak
[babeltrace.git] / types / types.c
index 5c8905517aadee42f95afec1d92df7530fa7ec79..675567f8f1819fcb28beb7c52ff911a54606482d 100644 (file)
@@ -37,6 +37,11 @@ struct type_class *ctf_lookup_type(GQuark qname)
                                   (gconstpointer) (unsigned long) qname)
 }
 
+static void free_type(struct type_class *type_class)
+{
+       type_class->free(type_class);
+}
+
 int ctf_register_type(struct type_class *type_class)
 {
        if (ctf_lookup_type_class(type_class->name))
@@ -51,7 +56,7 @@ int ctf_register_type(struct type_class *type_class)
 int ctf_init_types(void)
 {
        type_classes = g_hash_table_new_full(g_direct_hash, g_direct_equal,
-                                            NULL, g_free);
+                                            NULL, free_type);
        if (!type_classes)
                return -ENOMEM;
        return 0;
This page took 0.031434 seconds and 4 git commands to generate.