Use Py_CLEAR().
This commit is contained in:
parent
470a123910
commit
8ee604b989
|
@ -307,8 +307,7 @@ int unicode_resize(register PyUnicodeObject *unicode,
|
||||||
reset:
|
reset:
|
||||||
/* Reset the object caches */
|
/* Reset the object caches */
|
||||||
if (unicode->defenc) {
|
if (unicode->defenc) {
|
||||||
Py_DECREF(unicode->defenc);
|
Py_CLEAR(unicode->defenc);
|
||||||
unicode->defenc = NULL;
|
|
||||||
}
|
}
|
||||||
unicode->hash = -1;
|
unicode->hash = -1;
|
||||||
|
|
||||||
|
@ -427,8 +426,7 @@ void unicode_dealloc(register PyUnicodeObject *unicode)
|
||||||
unicode->length = 0;
|
unicode->length = 0;
|
||||||
}
|
}
|
||||||
if (unicode->defenc) {
|
if (unicode->defenc) {
|
||||||
Py_DECREF(unicode->defenc);
|
Py_CLEAR(unicode->defenc);
|
||||||
unicode->defenc = NULL;
|
|
||||||
}
|
}
|
||||||
/* Add to free list */
|
/* Add to free list */
|
||||||
*(PyUnicodeObject **)unicode = free_list;
|
*(PyUnicodeObject **)unicode = free_list;
|
||||||
|
|
Loading…
Reference in New Issue