Browse Source

[cpp] Closes #2563, free input and skeleton data on parsing failure.

Mario Zechner 1 year ago
parent
commit
82cb7f5cad
1 changed files with 2 additions and 0 deletions
  1. 2 0
      spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp

+ 2 - 0
spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp

@@ -125,6 +125,8 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons
 		char errorMsg[255];
 		char errorMsg[255];
 		snprintf(errorMsg, 255, "Skeleton version %s does not match runtime version %s", skeletonData->_version.buffer(), SPINE_VERSION_STRING);
 		snprintf(errorMsg, 255, "Skeleton version %s does not match runtime version %s", skeletonData->_version.buffer(), SPINE_VERSION_STRING);
 		setError(errorMsg, "");
 		setError(errorMsg, "");
+        delete input;
+        delete skeletonData;
 		return NULL;
 		return NULL;
 	}
 	}