mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-18 15:48:48 +00:00
Fixed some more leaks and mismatched allocations/deallocations.
svn-id: r35277
This commit is contained in:
parent
3de7a31dc1
commit
6ecc17010d
@ -283,7 +283,7 @@ Cnv* DosDisk_ns::loadExternalCnv(const char *filename) {
|
||||
uint16 height = stream->readByte();
|
||||
uint32 decsize = numFrames * width * height;
|
||||
|
||||
byte *data = (byte*)malloc(decsize);
|
||||
byte *data = new byte[decsize];
|
||||
stream->read(data, decsize);
|
||||
delete stream;
|
||||
|
||||
@ -299,7 +299,7 @@ Frames* DosDisk_ns::loadCnv(const char *filename) {
|
||||
uint16 width = stream->readByte();
|
||||
uint16 height = stream->readByte();
|
||||
uint32 decsize = numFrames * width * height;
|
||||
byte *data = (byte*)malloc(decsize);
|
||||
byte *data = new byte[decsize];
|
||||
|
||||
Graphics::PackBitsReadStream decoder(*stream);
|
||||
decoder.read(data, decsize);
|
||||
@ -836,7 +836,8 @@ Cnv* AmigaDisk_ns::makeCnv(Common::SeekableReadStream *stream, bool disposeStrea
|
||||
stream->read(buf, rawsize);
|
||||
|
||||
uint32 decsize = numFrames * width * height;
|
||||
byte *data = (byte*)calloc(decsize, 1);
|
||||
byte *data = new byte[decsize];
|
||||
memset(data, 0, decsize);
|
||||
|
||||
unpackBitmap(data, buf, numFrames, bytesPerPlane, height);
|
||||
|
||||
|
@ -287,7 +287,7 @@ public:
|
||||
|
||||
~Cnv() {
|
||||
if (_freeData)
|
||||
free(_data);
|
||||
delete []_data;
|
||||
}
|
||||
|
||||
byte* getFramePtr(uint16 index) {
|
||||
|
@ -201,6 +201,10 @@ Zone::~Zone() {
|
||||
case kZoneMerge:
|
||||
delete u.merge;
|
||||
break;
|
||||
|
||||
case kZonePath:
|
||||
delete u.path;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user