From: Petri Lehtinen Date: Sun, 30 Oct 2011 12:31:27 +0000 (+0200) Subject: Fix the return value of set_discard (issue #10519) X-Git-Tag: v3.2.3rc1~457 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0aa8037149c24f9fe8c37c2e129eb904723a3a6;p=thirdparty%2FPython%2Fcpython.git Fix the return value of set_discard (issue #10519) --- diff --git a/Objects/setobject.c b/Objects/setobject.c index 9f39fcbadbc4..69eb88933de7 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -1942,9 +1942,10 @@ set_discard(PySetObject *so, PyObject *key) tmpkey = make_new_set(&PyFrozenSet_Type, key); if (tmpkey == NULL) return NULL; - result = set_discard_key(so, tmpkey); + rv = set_discard_key(so, tmpkey); Py_DECREF(tmpkey); - return result; + if (rv == -1) + return NULL; } Py_RETURN_NONE; }