From: Georg Brandl Date: Sun, 25 Sep 2005 06:16:28 +0000 (+0000) Subject: Commit memory leaking fix. X-Git-Tag: v2.4.2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e32757cf4f2c7a4f7dc7db9122451c1291d7cf5c;p=thirdparty%2FPython%2Fcpython.git Commit memory leaking fix. --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 0649854f5524..74f09d20684d 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7189,8 +7189,12 @@ win32_startfile(PyObject *self, PyObject *args) Py_BEGIN_ALLOW_THREADS rc = ShellExecute((HWND)0, NULL, filepath, NULL, NULL, SW_SHOWNORMAL); Py_END_ALLOW_THREADS - if (rc <= (HINSTANCE)32) - return win32_error("startfile", filepath); + if (rc <= (HINSTANCE)32) { + PyObject *errval = win32_error("startfile", filepath); + PyMem_Free(filepath); + return errval; + } + PyMem_Free(filepath); Py_INCREF(Py_None); return Py_None; }