fix possible double free in TextIOWrapper.__init__ (closes #22849)

This commit is contained in:
Benjamin Peterson 2014-11-12 10:19:46 -05:00
parent dfede95a06
commit 6c14f23100
3 changed files with 18 additions and 1 deletions

View file

@ -1061,7 +1061,7 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
}
/* Finished sorting out the codec details */
Py_DECREF(codec_info);
Py_CLEAR(codec_info);
self->buffer = buffer;
Py_INCREF(buffer);