diff --git a/spine-c/include/spine/extension.h b/spine-c/include/spine/extension.h index 1477921f6..09427b862 100644 --- a/spine-c/include/spine/extension.h +++ b/spine-c/include/spine/extension.h @@ -55,7 +55,7 @@ #define FREE(VALUE) _free((void*)VALUE) /* Allocates a new char[], assigns it to TO, and copies FROM to it. Can be used on const types. */ -#define MALLOC_STR(TO,FROM) strcpy(CONST_CAST(char*, TO) = (char*)malloc(strlen(FROM) + 1), FROM) +#define MALLOC_STR(TO,FROM) strcpy(CONST_CAST(char*, TO) = (char*)MALLOC(char, strlen(FROM) + 1), FROM) #ifdef __STDC_VERSION__ #define FMOD(A,B) fmodf(A, B) diff --git a/spine-c/src/spine/RegionAttachment.c b/spine-c/src/spine/RegionAttachment.c index d4e08e56e..eb15f0e46 100644 --- a/spine-c/src/spine/RegionAttachment.c +++ b/spine-c/src/spine/RegionAttachment.c @@ -34,6 +34,7 @@ void _spRegionAttachment_dispose (spAttachment* attachment) { spRegionAttachment* self = SUB_CAST(spRegionAttachment, attachment); _spAttachment_deinit(attachment); + FREE(self->path); FREE(self); }