From: Michael Snyder Date: Wed, 8 Aug 2007 21:46:37 +0000 (+0000) Subject: 2007-08-08 Michael Snyder X-Git-Tag: gdb_6_7-2007-09-07-branchpoint~326 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6225abfaac49bed9804f8afea2109566b9c18c3d;p=external%2Fbinutils.git 2007-08-08 Michael Snyder * varobj.c (value_of_root): Move alloc after return to avoid leak. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ecef0e8..9e9724f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2007-08-08 Michael Snyder + * varobj.c (value_of_root): Move alloc after return to avoid leak. + * tui/tui-layout.c (tui_set_layout): Dead code, dead variable. * top.c (command_line_input): Memory leak. diff --git a/gdb/varobj.c b/gdb/varobj.c index c19bd20..dbeaff4 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1710,13 +1710,14 @@ value_of_root (struct varobj **var_handle, int *type_changed) { struct varobj *tmp_var; char *old_type, *new_type; - old_type = varobj_get_type (var); + tmp_var = varobj_create (NULL, var->name, (CORE_ADDR) 0, USE_SELECTED_FRAME); if (tmp_var == NULL) { return NULL; } + old_type = varobj_get_type (var); new_type = varobj_get_type (tmp_var); if (strcmp (old_type, new_type) == 0) {