From e901d1fbdff989c3d4b47eb46b0eb1ae6e46b71c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 17 Jul 2013 21:58:41 +0200 Subject: [PATCH] Issue #18408: Fix Py_ReprEnter(), handle PyList_Append() failure --- Objects/object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/object.c b/Objects/object.c index 700e8bef56..e957d9d7b0 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1910,7 +1910,8 @@ Py_ReprEnter(PyObject *obj) if (PyList_GET_ITEM(list, i) == obj) return 1; } - PyList_Append(list, obj); + if (PyList_Append(list, obj) < 0) + return -1; return 0; } -- 2.40.0