Commit a8d64ae3 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #17034: Use Py_CLEAR() in stringobject.c.

parent 05fd7441
......@@ -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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment