diff --git a/coders/svg.c b/coders/svg.c
index e4f2df0..e946461 100644
--- a/coders/svg.c
+++ b/coders/svg.c
@@ -3078,7 +3078,10 @@
     return((Image *) NULL);
   svg_info=AcquireSVGInfo();
   if (svg_info == (SVGInfo *) NULL)
-    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+    {
+      (void) fclose(file);
+      ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+    }
   svg_info->file=file;
   svg_info->exception=exception;
   svg_info->image=image;