Fix:core:Check for nullpointers before use members in graphics_free()
authorwoglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 1 May 2011 22:09:54 +0000 (22:09 +0000)
committerwoglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 1 May 2011 22:09:54 +0000 (22:09 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4462 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/graphics.c

index 3d06315..0687ccc 100644 (file)
@@ -393,6 +393,8 @@ struct graphics_font * graphics_named_font_new(struct graphics *gra, char *font,
  */
 void graphics_free(struct graphics *gra)
 {
+       if (!gra)
+               return;
        gra->meth.graphics_destroy(gra->priv);
        g_free(gra->default_font);
        graphics_font_destroy_all(gra);