mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Fix memory leaks in test_capi (#98017)
This commit is contained in:
parent
f99bb20cde
commit
be4099e55d
2 changed files with 6 additions and 0 deletions
|
|
@ -5210,6 +5210,7 @@ dict_watch_callback(PyDict_WatchEvent event,
|
|||
Py_DECREF(msg);
|
||||
return -1;
|
||||
}
|
||||
Py_DECREF(msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -5224,8 +5225,10 @@ dict_watch_callback_second(PyDict_WatchEvent event,
|
|||
return -1;
|
||||
}
|
||||
if (PyList_Append(g_dict_watch_events, msg) < 0) {
|
||||
Py_DECREF(msg);
|
||||
return -1;
|
||||
}
|
||||
Py_DECREF(msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue