Cleanup: make grumpy asan happy and do not use new [] to allocate data freed by free().

Probably nothing crucial, but asan build would crash on that stupid glitch... Annoying.
This commit is contained in:
Bastien Montagne 2015-04-29 17:46:03 +02:00
parent 091832c955
commit 0dbc9060a6

@ -60,6 +60,7 @@
#include <PixelFormat.h> #include <PixelFormat.h>
#include <stdio.h> // printf #include <stdio.h> // printf
#include <stdlib.h> // malloc
#include <math.h> // sqrt #include <math.h> // sqrt
#include <sys/types.h> #include <sys/types.h>
@ -1147,7 +1148,7 @@ void* DirectDrawSurface::readData(uint &rsize)
uint size = stream.size - header_size; uint size = stream.size - header_size;
rsize = size; rsize = size;
unsigned char *data = new unsigned char[size]; unsigned char *data = (unsigned char *)malloc(sizeof(*data) * size);
stream.seek(header_size); stream.seek(header_size);
mem_read(stream, data, size); mem_read(stream, data, size);