override: Fix leaks in test
[platform/upstream/glib.git] / tests / gobject / override.c
index 22535a8..47702d7 100644 (file)
@@ -374,6 +374,8 @@ test (GType        type,
 
       if (strcmp (ret, expected_retval) != 0)
         failed = TRUE;
+
+      g_free (ret);
     }
 
 #ifndef VERBOSE
@@ -392,6 +394,7 @@ test (GType        type,
     }
 
   g_string_free (test_string, TRUE);
+  g_object_unref (self);
 }
      
 int
@@ -400,7 +403,6 @@ main (int argc, char **argv)
   g_log_set_always_fatal (g_log_set_always_fatal (G_LOG_FATAL_MASK) |
                          G_LOG_LEVEL_WARNING |
                          G_LOG_LEVEL_CRITICAL);
-  g_type_init();
 
   test (TEST_TYPE_A, "foo", "TestA::foo,TestI::foo", NULL);
   test (TEST_TYPE_A, "bar", "TestA::bar", NULL);