* [PATCH] Fix small memory leak in mi-cmd-var.c
@ 2006-12-08 2:10 Nick Roberts
2006-12-08 3:30 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Nick Roberts @ 2006-12-08 2:10 UTC (permalink / raw)
To: gdb-patches
This patch fixes a small memory leak (sizeof (struct varobj *) = 4)
that occurs each time -var-update is issued when rootcount = 0.
--
Nick http://www.inet.net.nz/~nickrob
2006-12-08 Nick Roberts <nickrob@snap.net.nz>
* mi/mi-cmd-var.c (mi_cmd_var_update): Fix memory leak.
*** mi-cmd-var.c 30 Nov 2006 11:45:31 +1300 1.26
--- mi-cmd-var.c 08 Dec 2006 15:04:16 +1300
*************** mi_cmd_var_update (char *command, char *
*** 500,509 ****
if ((*name == '*') && (*(name + 1) == '\0'))
{
nv = varobj_list (&rootlist);
if (mi_version (uiout) <= 1)
! cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
else
! cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changelist");
if (nv <= 0)
{
do_cleanups (cleanup);
--- 500,510 ----
if ((*name == '*') && (*(name + 1) == '\0'))
{
nv = varobj_list (&rootlist);
+ cleanup = make_cleanup (xfree, rootlist);
if (mi_version (uiout) <= 1)
! make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
else
! make_cleanup_ui_out_list_begin_end (uiout, "changelist");
if (nv <= 0)
{
do_cleanups (cleanup);
*************** mi_cmd_var_update (char *command, char *
*** 515,521 ****
varobj_update_one (*cr, print_values);
cr++;
}
- xfree (rootlist);
do_cleanups (cleanup);
}
else
--- 516,521 ----
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix small memory leak in mi-cmd-var.c
2006-12-08 2:10 [PATCH] Fix small memory leak in mi-cmd-var.c Nick Roberts
@ 2006-12-08 3:30 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2006-12-08 3:30 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb-patches
On Fri, Dec 08, 2006 at 03:05:50PM +1300, Nick Roberts wrote:
>
> This patch fixes a small memory leak (sizeof (struct varobj *) = 4)
> that occurs each time -var-update is issued when rootcount = 0.
OK, thanks.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-12-08 3:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-08 2:10 [PATCH] Fix small memory leak in mi-cmd-var.c Nick Roberts
2006-12-08 3:30 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox