@@ -3103,6 +3103,7 @@ interp_inline_newobj (TransformData *td, MonoMethod *target_method, MonoMethodSi
3103
3103
int dreg , this_reg = -1 ;
3104
3104
int prev_sp_offset ;
3105
3105
MonoClass * klass = target_method -> klass ;
3106
+ MonoMethodHeader * mheader = NULL ;
3106
3107
3107
3108
if (!(mono_interp_opt & INTERP_OPT_INLINE ) ||
3108
3109
!interp_method_check_inlining (td , target_method , csignature ))
@@ -3166,7 +3167,7 @@ interp_inline_newobj (TransformData *td, MonoMethod *target_method, MonoMethodSi
3166
3167
if (is_protected )
3167
3168
newobj_fast -> flags |= INTERP_INST_FLAG_PROTECTED_NEWOBJ ;
3168
3169
3169
- MonoMethodHeader * mheader = interp_method_get_header (target_method , error );
3170
+ mheader = interp_method_get_header (target_method , error );
3170
3171
goto_if_nok (error , fail );
3171
3172
3172
3173
if (!interp_inline_method (td , target_method , mheader , error ))
@@ -3180,6 +3181,7 @@ interp_inline_newobj (TransformData *td, MonoMethod *target_method, MonoMethodSi
3180
3181
push_var (td , dreg );
3181
3182
return TRUE;
3182
3183
fail :
3184
+ mono_metadata_free_mh (mheader );
3183
3185
// Restore the state
3184
3186
td -> sp = td -> stack + prev_sp_offset ;
3185
3187
td -> last_ins = prev_last_ins ;
@@ -3651,6 +3653,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
3651
3653
td -> ip += 5 ;
3652
3654
goto done ;
3653
3655
}
3656
+ mono_metadata_free_mh (mheader );
3654
3657
}
3655
3658
3656
3659
/*
0 commit comments