gdb/varobj.c: Fix leak

Whoops, this function returns a std::string.

gdb/ChangeLog:
2017-01-31  Pedro Alves  <palves@redhat.com>

	* varobj.c (varobj_value_get_print_value): Remove xstrdup call.
This commit is contained in:
Pedro Alves 2017-01-31 17:56:36 +00:00
parent 60adb36c08
commit b47413b47e
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2017-01-31 Pedro Alves <palves@redhat.com>
* varobj.c (varobj_value_get_print_value): Remove xstrdup call.
2017-01-31 Pedro Alves <palves@redhat.com>
* common/scoped_restore.h

View File

@ -2432,7 +2432,7 @@ varobj_value_get_print_value (struct value *value,
if (dynamic_varobj_has_child_method (var))
{
do_cleanups (old_chain);
return xstrdup ("{...}");
return "{...}";
}
if (PyObject_HasAttr (value_formatter, gdbpy_to_string_cst))