Fixed some simple cppcheck warnings.

svn-id: r46303
This commit is contained in:
Torbjörn Andersson 2009-12-09 06:33:00 +00:00
parent 4218d3f037
commit 8ec098d016
2 changed files with 5 additions and 3 deletions

View File

@ -433,7 +433,7 @@ MidiDriver_Amiga::Instrument *MidiDriver_Amiga::readInstrument(Common::File &fil
if (file.read(instrument->samples, size) < (unsigned int)size) {
warning("[sfx:seq:amiga] failed to read instrument samples");
free(instrument->samples);
free(instrument);
delete instrument;
return NULL;
}
@ -449,7 +449,7 @@ MidiDriver_Amiga::Instrument *MidiDriver_Amiga::readInstrument(Common::File &fil
if (seg_size[1] < 0) {
warning("[sfx:seq:amiga] invalid looping point");
free(instrument->samples);
free(instrument);
delete instrument;
return NULL;
}

View File

@ -596,8 +596,10 @@ int32 Screen::initialisePsxBackgroundLayer(byte *parallax) {
return RDERR_OUTOFMEMORY;
_blockSurfaces[_layer] = (BlockSurface **)calloc(_xBlocks[_layer] * _yBlocks[_layer], sizeof(BlockSurface *));
if (!_blockSurfaces[_layer])
if (!_blockSurfaces[_layer]) {
free(tileChunk);
return RDERR_OUTOFMEMORY;
}
// Group PSX background (64x32, when stretched vertically) tiles together,
// to make them compatible with pc version (composed by 64x64 tiles)