[Mono-dev] [PATCH] Memory leak in mono_bounded_array_class_get

Raja R Harinath rharinath at novell.com
Tue Jul 24 10:22:05 EDT 2007


Hi,

Paolo Molaro <lupus at ximian.com> writes:

> On 07/23/07 Rodrigo Kumpera wrote:
>> The attached patch fix a memory leak in class.c, memory is allocated in
>> mono_bounded_array_class_get and the copied in
>> mono_metadata_get_generic_inst, but never freed.
>
> In this case it's better to have:
> 	MonoType *args;
> 	args = &iface->byval_arg;
> and pass &args to the function.

Better yet, just change the

  MonoType **args;

to

  MonoType *args [1];

- Hari



More information about the Mono-devel-list mailing list