memory leak fix.

This commit is contained in:
Jean-François DEL NERO
2023-11-12 12:28:35 +01:00
parent 371a032141
commit adb3a5a4f4
@@ -217,7 +217,7 @@ int ATR_libLoad_DiskFile(HXCFE_IMGLDR * imgldr_ctx,HXCFE_FLOPPY * floppydisk,cha
memset(sectorconfig,0,sizeof(HXCFE_SECTCFG)*floppydisk->floppySectorPerTrack);
trackdata=(unsigned char*)malloc(sectorsize*floppydisk->floppySectorPerTrack);
trackdata = (unsigned char*)malloc(sectorsize*floppydisk->floppySectorPerTrack);
if( !trackdata )
goto alloc_error;
@@ -278,6 +278,7 @@ int ATR_libLoad_DiskFile(HXCFE_IMGLDR * imgldr_ctx,HXCFE_FLOPPY * floppydisk,cha
}
}
free(trackdata);
free(sectorconfig);
imgldr_ctx->hxcfe->hxc_printf(MSG_INFO_1,"track file successfully loaded and encoded!");