core, fix crash if image couldn't be loaded
authorkub <derkub@gmail.com>
Sat, 3 Jun 2023 07:50:23 +0000 (07:50 +0000)
committerkub <derkub@gmail.com>
Sat, 3 Jun 2023 07:50:23 +0000 (07:50 +0000)
pico/media.c

index 27f0c14..7c147b2 100644 (file)
@@ -395,7 +395,7 @@ out:
   if (rom_file)
     pm_close(rom_file);
   if (rom_data)
-    free(rom_data);
+    PicoCartUnload();
   return media_type;
 }