aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-07-09 20:29:56 +0000
committerTom Tromey <tromey@redhat.com>2010-07-09 20:29:56 +0000
commitf04e4012c7a78c18a4aa57f8d5fb8759e2e48411 (patch)
tree08d3326d242ed51076f26a5637afed0c5631e323 /gdb/python
parentf4dfd9c05c7ef31b55c401c1ac491c5d71b845b6 (diff)
downloadgdb-f04e4012c7a78c18a4aa57f8d5fb8759e2e48411.zip
gdb-f04e4012c7a78c18a4aa57f8d5fb8759e2e48411.tar.gz
gdb-f04e4012c7a78c18a4aa57f8d5fb8759e2e48411.tar.bz2
* python/py-prettyprint.c (gdbpy_get_display_hint): Don't use
'hint' if it is NULL.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-prettyprint.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index 9a205b4..434c8a5 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 ();