Skip to content

Commit 847fb82

Browse files
authored
Merge pull request #520 from dynapx/fix-test-extension-npd
fix(c-api): add missing NULL check after Py_BuildValue in _test_exten…
2 parents 0b471ba + ac6d19a commit 847fb82

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/greenlet/tests/_test_extension.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ test_throw(PyObject* UNUSED(self), PyGreenlet* g)
162162
{
163163
const char msg[] = "take that sucka!";
164164
PyObject* msg_obj = Py_BuildValue("s", msg);
165+
166+
if (msg_obj == NULL) {
167+
return NULL;
168+
}
169+
170+
165171
PyGreenlet_Throw(g, PyExc_ValueError, msg_obj, NULL);
166172
Py_DECREF(msg_obj);
167173
if (PyErr_Occurred()) {

0 commit comments

Comments
 (0)