Fix potential memory leaks.

(Merging pull request #234, amended by jacksonmj: some leaks already fixed in develop branch.)
This commit is contained in:
Martin Ettl 2014-12-23 11:55:37 +01:00 committed by jacksonmj
parent 93eb934322
commit 34c85c262c

View File

@ -2170,7 +2170,7 @@ char * GameSave::serialiseOPS(int & dataLength)
if (BZ2_bzBuffToBuffCompress((char*)(outputData+12), &outputDataLen, (char*)finalData, bson_size(&b), 9, 0, 0) != BZ_OK) if (BZ2_bzBuffToBuffCompress((char*)(outputData+12), &outputDataLen, (char*)finalData, bson_size(&b), 9, 0, 0) != BZ_OK)
{ {
puts("Save Error\n"); puts("Save Error\n");
free(outputData); delete [] outputData;
dataLength = 0; dataLength = 0;
outputData = NULL; outputData = NULL;
goto fin; goto fin;