This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix a value leak by VAROBJ


Jan Kratochvil wrote:

> Hi,
> 
> a memory leak.  install_new_value() already release_value()s `var->value'.
> 
> No regressions on x86_64-unknown-linux-gnu (there is now a recent regression
> on HEAD for gdb.base/sigbpt.exp but it is unrelated to this patch).
> 
> 
> Thanks,
> Jan
> 
> 
> gdb/
> 2009-03-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> * varobj.c (free_variable): Call value_free.
> 
> --- gdb/varobj.c      5 Feb 2009 17:28:21 -0000       1.123
> +++ gdb/varobj.c      9 Mar 2009 17:35:49 -0000
> @@ -1512,6 +1512,8 @@ new_root_variable (void)
>  static void
>  free_variable (struct varobj *var)
>  {
> +  value_free (var->value);
> +
>    /* Free the expression if this is a root variable. */
>    if (is_root_p (var))
>      {

This is OK.

Thanks,
Volodya



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]