]> granicus.if.org Git - python/commitdiff
Backport r55070: Stop using PyMem_FREE while the GIL is not held.
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 9 May 2007 06:45:53 +0000 (06:45 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 9 May 2007 06:45:53 +0000 (06:45 +0000)
Modules/posixmodule.c

index b984c3004a10dbbd6224a4d700c84ae31b597fe1..215930f2a286615c61dc15b3cf8d682131185c62 100644 (file)
@@ -6207,8 +6207,8 @@ posix_fdopen(PyObject *self, PyObject *args)
 #else
        fp = fdopen(fd, mode);
 #endif
-       PyMem_FREE(mode);
        Py_END_ALLOW_THREADS
+       PyMem_FREE(mode);
        if (fp == NULL)
                return posix_error();
        f = PyFile_FromFile(fp, "<fdopen>", orgmode, fclose);