From: Raymond Hettinger Date: Sun, 13 Jun 2004 15:36:56 +0000 (+0000) Subject: Fixup error exits in nlargest() and nsmallest(). X-Git-Tag: v2.4a1~192 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de72eddf69e5ea6dbd3591ddfef5602b5b455942;p=python Fixup error exits in nlargest() and nsmallest(). --- diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c index 61ee413439..8074bb111d 100644 --- a/Modules/_heapqmodule.c +++ b/Modules/_heapqmodule.c @@ -230,13 +230,17 @@ nlargest(PyObject *self, PyObject *args) return NULL; heap = PyList_New(0); - if (it == NULL) + if (heap == NULL) goto fail; for (i=0 ; i