diff --git a/obrender/image.c b/obrender/image.c
index cffbaf3..5c689c4 100644
--- a/obrender/image.c
+++ b/obrender/image.c
@@ -476,17 +476,18 @@ struct _ImlibLoader
     Imlib_Image img;
 };
 
 void DestroyImlibLoader(ImlibLoader *loader)
 {
     if (!loader)
         return;
 
-    imlib_free_image();
+    if (loader->img)
+        imlib_free_image();
     g_slice_free(ImlibLoader, loader);
 }
 
 ImlibLoader* LoadWithImlib(gchar *path,
                            RrPixel32 **pixel_data,
                            gint *width,
                            gint *height)
 {
