]> code.delx.au - refind/blobdiff - refind/icns.c
TianoCore build support; new use_graphics_for refind.conf token
[refind] / refind / icns.c
index 1bc320245df20ccf0ca3fa51195ac82deec7eaf5..f9be58be75f0a75adaf67db0df3118c7629390fe 100644 (file)
@@ -38,6 +38,7 @@
 #include "lib.h"
 #include "icns.h"
 #include "config.h"
+#include "../refind/screen.h"
 
 //
 // well-known icons
@@ -100,8 +101,10 @@ EG_IMAGE * LoadOSIcon(IN CHAR16 *OSIconName OPTIONAL, IN CHAR16 *FallbackIconNam
 
         // try to load it
         Image = egLoadIcon(SelfDir, FileName, 128);
-        if (Image != NULL)
+        if (Image != NULL) {
+            FreePool(CutoutName);
             return Image;
+        }
         FreePool(CutoutName);
     } // while
 
@@ -160,7 +163,7 @@ EG_IMAGE * DummyImage(IN UINTN PixelSize)
         }
         YPtr += LineOffset;
     }
-    
+
     return Image;
 }