summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index a9b3324..93c1025 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -13455,6 +13455,9 @@ PyUnicodeWriter_Create(Py_ssize_t length)
void PyUnicodeWriter_Discard(PyUnicodeWriter *writer)
{
+ if (writer == NULL) {
+ return;
+ }
_PyUnicodeWriter_Dealloc((_PyUnicodeWriter*)writer);
PyMem_Free(writer);
}