Commit 8ee604b9 authored by Georg Brandl's avatar Georg Brandl

Use Py_CLEAR().

parent 470a1239
...@@ -307,8 +307,7 @@ int unicode_resize(register PyUnicodeObject *unicode, ...@@ -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) ...@@ -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;
......
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