[KoCo-CVS] [Commit] cjkcodecs/src multibytecodec.c
Brought to you by:
perky
From: Hye-Shik C. <pe...@us...> - 2003-05-27 06:32:36
|
perky 03/05/26 23:32:36 Modified: src multibytecodec.c Log: Increase refcount of self->stream before resolving error callback. Destructor could try to decref for self->stream when the resolving was failed. Revision Changes Path 1.12 +10 -10 cjkcodecs/src/multibytecodec.c Index: multibytecodec.c =================================================================== RCS file: /cvsroot/koco/cjkcodecs/src/multibytecodec.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- multibytecodec.c 27 May 2003 06:24:41 -0000 1.11 +++ multibytecodec.c 27 May 2003 06:32:36 -0000 1.12 @@ -26,7 +26,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: multibytecodec.c,v 1.11 2003/05/27 06:24:41 perky Exp $ + * $Id: multibytecodec.c,v 1.12 2003/05/27 06:32:36 perky Exp $ */ #include "Python.h" @@ -1064,16 +1064,16 @@ if (self == NULL) return NULL; - self->errors = get_errorcallback(errors); - if (self->errors == NULL) { - Py_DECREF(self); - return NULL; - } self->codec = codec; self->stream = stream; Py_INCREF(stream); self->state.p = NULL; self->pendingsize = 0; + self->errors = get_errorcallback(errors); + if (self->errors == NULL) { + Py_DECREF(self); + return NULL; + } return (PyObject *)self; } @@ -1089,15 +1089,15 @@ if (self == NULL) return NULL; + self->codec = codec; + self->stream = stream; + Py_INCREF(stream); + self->state.p = NULL; self->errors = get_errorcallback(errors); if (self->errors == NULL) { Py_DECREF(self); return NULL; } - self->codec = codec; - self->stream = stream; - Py_INCREF(stream); - self->state.p = NULL; return (PyObject *)self; } |