Fix memory leak setting error text in the data-transfer modifier

This commit is contained in:
Campbell Barton 2020-08-11 17:07:15 +10:00
parent 9adedb2605
commit bb5cc3bccf
Notes: blender-bot 2023-02-14 04:40:22 +01:00
Referenced by issue #79710, Snapping icon don't change when activating snap while moving object, vertex, edge, etc
1 changed files with 3 additions and 1 deletions

View File

@ -229,7 +229,9 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
&reports);
if (BKE_reports_contain(&reports, RPT_ERROR)) {
BKE_modifier_set_error(md, "%s", BKE_reports_string(&reports, RPT_ERROR));
const char *report_str = BKE_reports_string(&reports, RPT_ERROR);
BKE_modifier_set_error(md, "%s", report_str);
MEM_freeN((void *)report_str);
}
else if ((dtmd->data_types & DT_TYPE_LNOR) && !(me->flag & ME_AUTOSMOOTH)) {
BKE_modifier_set_error((ModifierData *)dtmd, "Enable 'Auto Smooth' in Object Data Properties");