mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-134885: zstd: Use Py_XSETREF (GH-134886)
This commit is contained in:
parent
b367e27af9
commit
45c6c48afc
2 changed files with 6 additions and 7 deletions
|
@ -0,0 +1,2 @@
|
|||
Fix possible crash in the :mod:`compression.zstd` module related to setting
|
||||
parameter types. Patch by Jelle Zijlstra.
|
|
@ -514,13 +514,10 @@ _zstd_set_parameter_types_impl(PyObject *module, PyObject *c_parameter_type,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
Py_XDECREF(mod_state->CParameter_type);
|
||||
Py_INCREF(c_parameter_type);
|
||||
mod_state->CParameter_type = (PyTypeObject*)c_parameter_type;
|
||||
|
||||
Py_XDECREF(mod_state->DParameter_type);
|
||||
Py_INCREF(d_parameter_type);
|
||||
mod_state->DParameter_type = (PyTypeObject*)d_parameter_type;
|
||||
Py_XSETREF(
|
||||
mod_state->CParameter_type, (PyTypeObject*)Py_NewRef(c_parameter_type));
|
||||
Py_XSETREF(
|
||||
mod_state->DParameter_type, (PyTypeObject*)Py_NewRef(d_parameter_type));
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue