Initialize variable in py_get_event_thread
The pythread variable could be used without being initialized, fix it by initializing it to nullptr. gdb/ChangeLog: * python/py-threadevent.c (py_get_event_thread): Initialize pythread.
This commit is contained in:
parent
7a815dd566
commit
bbbbbceebc
2 changed files with 7 additions and 2 deletions
|
@ -25,7 +25,7 @@
|
|||
PyObject *
|
||||
py_get_event_thread (ptid_t ptid)
|
||||
{
|
||||
PyObject *pythread;
|
||||
PyObject *pythread = nullptr;
|
||||
|
||||
if (non_stop)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ py_get_event_thread (ptid_t ptid)
|
|||
else
|
||||
pythread = Py_None;
|
||||
|
||||
if (!pythread)
|
||||
if (pythread == nullptr)
|
||||
{
|
||||
PyErr_SetString (PyExc_RuntimeError, "Could not find event thread");
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue