From: notaz Date: Sun, 16 Apr 2017 21:36:30 +0000 (+0300) Subject: fix broken error path X-Git-Tag: v1.92~64 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01685eefb022ab2d13cc154a43807e9d20c77c03;p=picodrive.git fix broken error path --- diff --git a/pico/cart.c b/pico/cart.c index bb452c0b..d091d623 100644 --- a/pico/cart.c +++ b/pico/cart.c @@ -569,7 +569,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; }