]> granicus.if.org Git - python/commitdiff
Set data pointer to NULL after an error; this keeps the mmap_dealloc() function from...
authorAndrew M. Kuchling <amk@amk.ca>
Wed, 19 May 2004 14:39:08 +0000 (14:39 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Wed, 19 May 2004 14:39:08 +0000 (14:39 +0000)
2.3 bugfix candidate, but this bug isn't critical enough that the fix has to go into 2.3.4

Modules/mmapmodule.c

index 6cb47171b639b9630789de8bb985ae8c563c3de5..e1a2f4238b930b9c2709d5e55478d99c32972524 100644 (file)
@@ -912,6 +912,7 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict)
                           prot, flags,
                           fd, 0);
        if (m_obj->data == (char *)-1) {
+               m_obj->data = NULL;
                Py_DECREF(m_obj);
                PyErr_SetFromErrno(mmap_module_error);
                return NULL;