From: notaz Date: Sun, 16 Apr 2017 21:36:30 +0000 (+0300) Subject: fix broken error path X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=picodrive.git;a=commitdiff_plain;h=3d5e32fe21b56d59a116195a66f300735af5a7ec fix broken error path --- diff --git a/pico/cart.c b/pico/cart.c index 25a847d..b35eb53 100644 --- a/pico/cart.c +++ b/pico/cart.c @@ -513,7 +513,7 @@ int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize,int is_sms) bytes_read = pm_read(rom,size,f); // Load up the rom if (bytes_read <= 0) { elprintf(EL_STATUS, "read failed"); - free(rom); + plat_munmap(rom, rom_alloc_size); return 3; }