diff Modules/cStringIO.c @ 36878:accfb156f9cc 2.4

Backport r42894: SF #1444030 Fix several potential defects found by Coverity.
author Hye-Shik Chang <hyeshik@gmail.com>
date Tue, 07 Mar 2006 15:59:09 +0000
parents e0a9f66b7014
children 6fb46e87d5f9
line wrap: on
line diff
--- a/Modules/cStringIO.c	Tue Mar 07 14:16:02 2006 +0000
+++ b/Modules/cStringIO.c	Tue Mar 07 15:59:09 2006 +0000
@@ -541,6 +541,7 @@
         UNLESS (self->buf = (char *)malloc(size)) {
                   PyErr_SetString(PyExc_MemoryError,"out of memory");
                   self->buf_size = 0;
+                  Py_DECREF(self);
                   return NULL;
           }