From f04e4012c7a78c18a4aa57f8d5fb8759e2e48411 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 9 Jul 2010 20:29:56 +0000 Subject: [PATCH] * python/py-prettyprint.c (gdbpy_get_display_hint): Don't use 'hint' if it is NULL. --- gdb/ChangeLog | 5 +++++ gdb/python/py-prettyprint.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0e8cea36d3e..d1964c1208a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-07-09 Tom Tromey + + * python/py-prettyprint.c (gdbpy_get_display_hint): Don't use + 'hint' if it is NULL. + 2010-07-09 Hui Zhu * source.c (print_source_lines_base): Add check for noprint. diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 9a205b4ab7f..434c8a593da 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -229,10 +229,12 @@ gdbpy_get_display_hint (PyObject *printer) return NULL; hint = PyObject_CallMethodObjArgs (printer, gdbpy_display_hint_cst, NULL); - if (gdbpy_is_string (hint)) - result = python_string_to_host_string (hint); if (hint) - Py_DECREF (hint); + { + if (gdbpy_is_string (hint)) + result = python_string_to_host_string (hint); + Py_DECREF (hint); + } else gdbpy_print_stack (); -- 2.30.2