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

Rodrigo Kumpera kumpera at gmail.com
Tue Jul 24 10:37:15 EDT 2007


Hey,

Attached is the patch with Raja's suggestion, it passes the regression
suite.

Rodrigo

On 7/24/07, Raja R Harinath <rharinath at novell.com> wrote:
>
> 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
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070724/7e32a0ff/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: leak.diff
Type: text/x-patch
Size: 1077 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070724/7e32a0ff/attachment.bin 


More information about the Mono-devel-list mailing list