mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #17034: Use Py_CLEAR() in stringobject.c.
This commit is contained in:
parent
05fd744122
commit
a8d64ae304
1 changed files with 5 additions and 10 deletions
|
@ -3859,8 +3859,7 @@ PyString_Concat(register PyObject **pv, register PyObject *w)
|
|||
if (*pv == NULL)
|
||||
return;
|
||||
if (w == NULL || !PyString_Check(*pv)) {
|
||||
Py_DECREF(*pv);
|
||||
*pv = NULL;
|
||||
Py_CLEAR(*pv);
|
||||
return;
|
||||
}
|
||||
v = string_concat((PyStringObject *) *pv, w);
|
||||
|
@ -4790,12 +4789,9 @@ void
|
|||
PyString_Fini(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < UCHAR_MAX + 1; i++) {
|
||||
Py_XDECREF(characters[i]);
|
||||
characters[i] = NULL;
|
||||
}
|
||||
Py_XDECREF(nullstring);
|
||||
nullstring = NULL;
|
||||
for (i = 0; i < UCHAR_MAX + 1; i++)
|
||||
Py_CLEAR(characters[i]);
|
||||
Py_CLEAR(nullstring);
|
||||
}
|
||||
|
||||
void _Py_ReleaseInternedStrings(void)
|
||||
|
@ -4845,6 +4841,5 @@ void _Py_ReleaseInternedStrings(void)
|
|||
"mortal/immortal\n", mortal_size, immortal_size);
|
||||
Py_DECREF(keys);
|
||||
PyDict_Clear(interned);
|
||||
Py_DECREF(interned);
|
||||
interned = NULL;
|
||||
Py_CLEAR(interned);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue