[patch] Fix a value leak by VAROBJ

Vladimir Prus vladimir@codesourcery.com
Mon Mar 9 22:33:00 GMT 2009


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




More information about the Gdb-patches mailing list