Free path only if it's not null
authordanigm <dani@danigm.net>
Sun, 15 Aug 2010 12:25:13 +0000 (14:25 +0200)
committerdanigm <dani@danigm.net>
Sun, 15 Aug 2010 12:25:13 +0000 (14:25 +0200)
src/tbo-object-svg.c

index 4d6c3c4..9da0ae8 100644 (file)
@@ -137,7 +137,8 @@ tbo_object_svg_init (TboObjectSvg *self)
 static void
 tbo_object_svg_finalize (GObject *self)
 {
-    g_string_free (TBO_OBJECT_SVG (self)->path, TRUE);
+    if (TBO_OBJECT_SVG (self)->path)
+        g_string_free (TBO_OBJECT_SVG (self)->path, TRUE);
     /* Chain up to the parent class */
     G_OBJECT_CLASS (tbo_object_svg_parent_class)->finalize (self);
 }