* python/py-prettyprint.c (gdbpy_get_display_hint): Don't use

'hint' if it is NULL.
This commit is contained in:
Tom Tromey 2010-07-09 20:29:56 +00:00
parent f4dfd9c05c
commit f04e4012c7
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2010-07-09 Tom Tromey <tromey@redhat.com>
* python/py-prettyprint.c (gdbpy_get_display_hint): Don't use
'hint' if it is NULL.
2010-07-09 Hui Zhu <teawater@gmail.com>
* source.c (print_source_lines_base): Add check for noprint.

View File

@ -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 ();