diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-05-20 02:38:12 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-05-20 02:38:12 (GMT) |
commit | b91ef008baf3f6954bf2849f7b5235f9d1a1f6d8 (patch) | |
tree | da17615f2a196cbb36dfdb639a3a166b3ed407b7 /Objects | |
parent | f41ffedad07520b4fcd34720677b1452fa5f867a (diff) | |
download | cpython-b91ef008baf3f6954bf2849f7b5235f9d1a1f6d8.zip cpython-b91ef008baf3f6954bf2849f7b5235f9d1a1f6d8.tar.gz cpython-b91ef008baf3f6954bf2849f7b5235f9d1a1f6d8.tar.bz2 |
add missing NULL check (closes #18019)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index ba36b18..39e7035 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -2919,6 +2919,10 @@ dictview_repr(dictviewobject *dv) return NULL; seq_str = PyObject_Repr(seq); + if (seq_str == NULL) { + Py_DECREF(seq); + return NULL; + } result = PyString_FromFormat("%s(%s)", Py_TYPE(dv)->tp_name, PyString_AS_STRING(seq_str)); Py_DECREF(seq_str); |