Free string in the right place.
authorColin Walters <walters@verbum.org>
Tue, 26 Aug 2008 21:01:36 +0000 (21:01 +0000)
committerColin Walters <walters@src.gnome.org>
Tue, 26 Aug 2008 21:01:36 +0000 (21:01 +0000)
2008-08-26  Colin Walters  <walters@verbum.org>

* girepository/gtypelib.c (_g_typelib_init): Free
string in the right place.

svn path=/trunk/; revision=500

ChangeLog
girepository/gtypelib.c

index dc4810a72c0d02e9616ffd6283af8863b910db95..267f96058bcfb48f1379775bc3e528f8b750862b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-26  Colin Walters  <walters@verbum.org>
+
+       * girepository/gtypelib.c (_g_typelib_init): Free
+       string in the right place.
+
 2008-08-26  Colin Walters  <walters@verbum.org>
 
        * girepository/gtypelib.c (_g_typelib_init): Handle
index dc9eba00cec4188b2e98fd08fe6b9409cfab3072..395a83dc984c6563f6c024dc5c96f8c136f45bc1 100644 (file)
@@ -1953,6 +1953,7 @@ _g_typelib_init (GTypelib *typelib)
          if (typelib->module == NULL)
            {
              shlib_full = g_string_new (shlib);
+
              /* Prefix with "lib", try both .la and .so */
              if (!g_str_has_prefix (shlib_full->str, "lib"))
                g_string_prepend (shlib_full, "lib");
@@ -1961,11 +1962,12 @@ _g_typelib_init (GTypelib *typelib)
              if (typelib->module == NULL)
                g_string_overwrite (shlib_full, strlen (shlib_full->str)-2, "so");
              typelib->module = g_module_open (shlib_full->str, G_MODULE_BIND_LAZY);
+
+             g_string_free (shlib_full, TRUE);
            }
          if (typelib->module == NULL)
             g_warning ("Failed to load shared library '%s' referenced by the typelib: %s",
                        shlib, g_module_error ());
-         g_string_free (shlib_full, TRUE);
         }
     }
 }