From: Brett Cannon Date: Thu, 31 Aug 2006 18:54:26 +0000 (+0000) Subject: Make sure memory is properly cleaned up in file_init. X-Git-Tag: v2.6a1~2731 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b3666f73781b7c3207c5babda6edadaf85b8b30;p=python Make sure memory is properly cleaned up in file_init. Backport candidate. --- diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 5249f1cdc0..b43bf85b87 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -2016,7 +2016,7 @@ file_init(PyObject *self, PyObject *args, PyObject *kwds) if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|si:file", kwlist, &o_name, &mode, &bufsize)) - return -1; + goto Error; if (fill_file_fields(foself, NULL, o_name, mode, fclose) == NULL)