mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-26 04:08:13 +08:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user