This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/5] gdb/varobj.c: Fix leak
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 17 Jan 2017 01:39:04 +0000
- Subject: [PATCH 2/5] gdb/varobj.c: Fix leak
- Authentication-results: sourceware.org; auth=none
- References: <1484617147-2506-1-git-send-email-palves@redhat.com>
Whoops, this function returns a std::string.
gdb/ChangeLog:
2017-01-17 Pedro Alves <palves@redhat.com>
* varobj.c (varobj_value_get_print_value): Remove xstrdup call.
---
gdb/varobj.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 30dfb86..bcca6c6 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -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))
--
2.5.5