Fix: Memory leak in multiresbake_image_exec

MultiresBakeJob is allocated before a potential early return of the
operator, so free the data before returning.

Part of #120767

Pull Request: https://projects.blender.org/blender/blender/pulls/121102
This commit is contained in:
YimingWu
2024-05-03 06:21:08 +02:00
committed by YimingWu
parent 43b46503f1
commit d46fe49ab3

View File

@@ -561,6 +561,7 @@ static int multiresbake_image_exec(bContext *C, wmOperator *op)
if (!bkr->data.first) {
BKE_report(op->reports, RPT_ERROR, "No objects found to bake from");
MEM_freeN(bkr);
return OPERATOR_CANCELLED;
}