Skip to content

Commit

Permalink
[cpp] Closes #2622, fix memory leak in case of version mismatch.
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Sep 9, 2024
1 parent 0ffcc63 commit 0382679
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ SkeletonData *SkeletonJson::readSkeletonData(const char *json) {
if (!skeletonData->_version.startsWith(SPINE_VERSION_STRING)) {
char errorMsg[255];
snprintf(errorMsg, 255, "Skeleton version %s does not match runtime version %s", skeletonData->_version.buffer(), SPINE_VERSION_STRING);
delete skeletonData;
setError(NULL, errorMsg, "");
return NULL;
}
Expand Down

0 comments on commit 0382679

Please sign in to comment.