Fix potential memory leaks.
(Merging pull request #234, amended by jacksonmj: some leaks already fixed in develop branch.)
This commit is contained in:
parent
93eb934322
commit
34c85c262c
@ -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;
|
||||||
|
Reference in New Issue
Block a user