* varobj.c (value_of_root): Move alloc after return to avoid leak.
2007-08-08 Michael Snyder <msnyder@access-company.com>
+ * 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.
{
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)
{