--- gdb/varobj.c (/mirrors/gdb_mainline) (revision 3220) +++ gdb/varobj.c (/patches/gdb/release_value/gdb_mainline) (revision 3220) @@ -1985,13 +1985,8 @@ c_value_of_root (struct varobj **var_han if (within_scope) { /* We need to catch errors here, because if evaluate - expression fails we just want to make val->error = 1 and - go on */ - if (gdb_evaluate_expression (var->root->exp, &new_val)) - { - release_value (new_val); - } - + expression fails we want to just return NULL. */ + gdb_evaluate_expression (var->root->exp, &new_val); return new_val; } @@ -2003,8 +1998,6 @@ c_value_of_child (struct varobj *parent, { struct value *value = NULL; c_describe_child (parent, index, NULL, &value, NULL); - if (value != NULL) - release_value (value); return value; } @@ -2338,9 +2331,6 @@ cplus_value_of_child (struct varobj *par name = name_of_child (parent, index); gdb_value_struct_elt (NULL, &value, &temp, NULL, name, NULL, "cplus_structure"); - if (value != NULL) - release_value (value); - xfree (name); } else if (index >= TYPE_N_BASECLASSES (type)) @@ -2368,7 +2358,6 @@ cplus_value_of_child (struct varobj *par if (temp != NULL) { value = value_cast (TYPE_FIELD_TYPE (type, index), temp); - release_value (value); } else {