From: notaz Date: Fri, 11 Oct 2013 23:43:47 +0000 (+0300) Subject: fix use of freed mem X-Git-Tag: v1.91~2 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9993e0d6dd65e7065e81cab76791c7c607cda0b2;p=picodrive.git fix use of freed mem --- diff --git a/pico/cd/cd_image.c b/pico/cd/cd_image.c index 97c8f3f0..07b55ceb 100644 --- a/pico/cd/cd_image.c +++ b/pico/cd/cd_image.c @@ -183,7 +183,6 @@ int load_cd_image(const char *cd_img_name, int *type) elprintf(EL_STATUS, "Track %2i: %s %9i AUDIO %s", n, tmp_ext, length, cue_data->tracks[n].fname); } - cue_destroy(cue_data); goto finish; } @@ -260,6 +259,9 @@ finish: if (PicoCDLoadProgressCB != NULL) PicoCDLoadProgressCB(cd_img_name, 100); + if (cue_data != NULL) + cue_destroy(cue_data); + return 0; }