mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
Fixed memory leaks
This commit is contained in:
parent
181d9265a1
commit
2cd15502c4
@ -95,8 +95,10 @@ static uae_s32 ARCunsqueeze(struct zfile *in, struct zfile *out, struct rledata
|
||||
{
|
||||
numnodes = xadIOGetBitsLow(&io, 16);
|
||||
|
||||
if (io.err)
|
||||
if (io.err) {
|
||||
xfree(node);
|
||||
return XADERR_ILLEGALDATA;
|
||||
}
|
||||
|
||||
if(numnodes < 0 || numnodes >= ARCSQNUMVALS)
|
||||
err = XADERR_DECRUNCH;
|
||||
|
||||
11
debugmem.cpp
11
debugmem.cpp
@ -1574,6 +1574,9 @@ static uae_u8 *loadhunkfile(uae_u8 *file, int filelen, uae_u32 seglist, int segm
|
||||
int relochunk = gl(p);
|
||||
p += 4;
|
||||
if (relochunk > last) {
|
||||
xfree(hunkoffsets);
|
||||
xfree(hunklens);
|
||||
xfree(out);
|
||||
return 0;
|
||||
}
|
||||
uaecptr hunkptr = hunkoffsets[relochunk] + relocate_base;
|
||||
@ -2983,9 +2986,13 @@ static uae_u8 *loadelffile(uae_u8 *file, int filelen, uae_u8 *dbgfile, int debug
|
||||
#endif
|
||||
|
||||
end:
|
||||
xfree(lelfs);
|
||||
|
||||
if (startp && startseg >= 0)
|
||||
*startp = lelfs[startseg].dma->start;
|
||||
if (lelfs)
|
||||
*startp = lelfs[startseg].dma->start;
|
||||
|
||||
xfree(lelfs);
|
||||
|
||||
if (parentidp)
|
||||
*parentidp = parentid;
|
||||
return outp;
|
||||
|
||||
@ -864,6 +864,7 @@ static int vhd_write_enlarge (struct hardfiledata *hfd, uae_u32 bamoffset)
|
||||
buf = xcalloc (uae_u8, len);
|
||||
if (!hdf_resize_target (hfd, hfd->physsize + len - 512)) {
|
||||
write_log (_T("vhd_enlarge: failure\n"));
|
||||
xfree(buf);
|
||||
return 0;
|
||||
}
|
||||
// add footer (same as 512 byte header)
|
||||
|
||||
@ -2308,6 +2308,7 @@ bool trifecta_init(struct autoconfig_info *aci)
|
||||
ide_add_reset();
|
||||
if (!aci->doinit) {
|
||||
aci->autoconfigp = aci->ert->autoconfig;
|
||||
xfree(rom);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -2060,6 +2060,7 @@ static void add_shmmaps (uae_u32 start, addrbank *what)
|
||||
write_log (_T("NATMEM: Failure to map existing at %08x (%p)\n"), start, base);
|
||||
dumplist ();
|
||||
nocanbang ();
|
||||
xfree(y);
|
||||
return;
|
||||
}
|
||||
y->next = shm_start;
|
||||
|
||||
@ -972,8 +972,10 @@ bool ncr710_a4091_autoconfig_init (struct autoconfig_info *aci)
|
||||
}
|
||||
|
||||
struct ncr_state *ncr = getscsi(aci->rc);
|
||||
if (!ncr)
|
||||
if (!ncr) {
|
||||
xfree(rom);
|
||||
return false;
|
||||
}
|
||||
|
||||
xfree(ncr->rom);
|
||||
ncr->rom = rom;
|
||||
|
||||
@ -870,8 +870,10 @@ static void scanscsi (void)
|
||||
OPEN_EXISTING, // No special create flags
|
||||
0, // No special attributes
|
||||
NULL);
|
||||
if (h == INVALID_HANDLE_VALUE)
|
||||
if (h == INVALID_HANDLE_VALUE) {
|
||||
xfree(AdapterInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!DeviceIoControl (h,
|
||||
IOCTL_SCSI_RESCAN_BUS,
|
||||
|
||||
2
pci.cpp
2
pci.cpp
@ -1764,6 +1764,7 @@ bool dkb_wildfire_pci_init(struct autoconfig_info *aci)
|
||||
|
||||
device_add_reset(pci_reset);
|
||||
if (!aci->doinit) {
|
||||
xfree(pcib);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1883,6 +1884,7 @@ static bool grex_pci_init(struct autoconfig_info *aci)
|
||||
|
||||
device_add_reset(pci_reset);
|
||||
if (!aci->doinit) {
|
||||
xfree(pcib);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -113,6 +113,7 @@ void Depack_AmBk ( void )
|
||||
if ( j > 1 )
|
||||
{
|
||||
printf ( "\n!!! unsupported feature in depack_AmBk() - send this file to asle@free.fr !\n" );
|
||||
free(Whatever);
|
||||
return;
|
||||
}
|
||||
j = ((in_data[Where+2]*256*256*256)+(in_data[Where+3]*256*256)+(in_data[Where+4]*256)+in_data[Where+5]);
|
||||
|
||||
@ -349,5 +349,6 @@ void Depack_TMK ( void )
|
||||
/*fclose ( info );*/
|
||||
|
||||
printf ( "done\n" );
|
||||
free( samplesizes );
|
||||
return; /* useless ... but */
|
||||
}
|
||||
|
||||
@ -197,6 +197,7 @@ void *createIPC (const TCHAR *name, int binary)
|
||||
cnt++;
|
||||
continue;
|
||||
}
|
||||
xfree(ipc);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user