From: kub Date: Fri, 12 Mar 2021 21:09:17 +0000 (+0100) Subject: mcd, fix memory leaks X-Git-Tag: v2.00~587 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef3241d203ed1c4301d0aacab6325a44f19e9555;p=picodrive.git mcd, fix memory leaks --- diff --git a/pico/cd/cdd.c b/pico/cd/cdd.c index 8fa16e18..fd78c357 100644 --- a/pico/cd/cdd.c +++ b/pico/cd/cdd.c @@ -450,7 +450,7 @@ int cdd_unload(void) pm_close(cdd.toc.tracks[0].fd); cdd.toc.tracks[0].fd = NULL; if (cdd.toc.tracks[0].fname) - free(cdd.toc.tracks[0].fd); + free(cdd.toc.tracks[0].fname); cdd.toc.tracks[0].fname = NULL; } @@ -473,7 +473,7 @@ int cdd_unload(void) pm_close(cdd.toc.tracks[i].fd); cdd.toc.tracks[i].fd = NULL; if (cdd.toc.tracks[i].fname) - free(cdd.toc.tracks[i].fd); + free(cdd.toc.tracks[i].fname); cdd.toc.tracks[i].fname = NULL; /* detect single file images */ diff --git a/pico/cd/mcd.c b/pico/cd/mcd.c index ef21ca61..559fca7a 100644 --- a/pico/cd/mcd.c +++ b/pico/cd/mcd.c @@ -24,6 +24,7 @@ PICO_INTERNAL void PicoInitMCD(void) PICO_INTERNAL void PicoExitMCD(void) { + cdd_unload(); } PICO_INTERNAL void PicoPowerMCD(void)