diff --git a/rdtk/librdtk/rdtk_font.c b/rdtk/librdtk/rdtk_font.c index 97a13f16a..cf7ec6404 100644 --- a/rdtk/librdtk/rdtk_font.c +++ b/rdtk/librdtk/rdtk_font.c @@ -612,7 +612,6 @@ rdtkFont* rdtk_font_new(rdtkEngine* engine, const char* path, const char* file) strcpy(fontDescriptorFile, fontBaseFile); strcpy(&fontDescriptorFile[length], ".xml"); - free(fontBaseFile); if (!PathFileExistsA(fontImageFile)) goto cleanup; @@ -641,10 +640,12 @@ rdtkFont* rdtk_font_new(rdtkEngine* engine, const char* path, const char* file) if (status < 0) goto cleanup; + free(fontBaseFile); free(fontImageFile); free(fontDescriptorFile); return font; cleanup: + free(fontBaseFile); free(fontImageFile); free(fontDescriptorFile); diff --git a/rdtk/librdtk/rdtk_nine_patch.c b/rdtk/librdtk/rdtk_nine_patch.c index 818332f7b..c6532e044 100644 --- a/rdtk/librdtk/rdtk_nine_patch.c +++ b/rdtk/librdtk/rdtk_nine_patch.c @@ -390,6 +390,8 @@ int rdtk_nine_patch_engine_init(rdtkEngine* engine) if (ninePatch) rdtk_nine_patch_set_image(ninePatch, image); + else + winpr_image_free(image, TRUE); } } @@ -414,6 +416,8 @@ int rdtk_nine_patch_engine_init(rdtkEngine* engine) if (ninePatch) rdtk_nine_patch_set_image(ninePatch, image); + else + winpr_image_free(image, TRUE); } }