Ticket #166: cspeedups-fix-memleak-r780.diff
| File cspeedups-fix-memleak-r780.diff, 1.4 KB (added by cboos, 4 years ago) |
|---|
-
trunk/genshi/_speedups.c
87 87 88 88 out = (PyUnicodeObject*) PyUnicode_FromUnicode(NULL, len); 89 89 if (out == NULL) { 90 Py_DECREF((PyObject *) in); 90 91 return NULL; 91 92 } 92 93 … … 130 131 inp++; 131 132 } 132 133 134 Py_DECREF((PyObject *) in); 135 133 136 args = PyTuple_New(1); 134 137 if (args == NULL) { 135 138 Py_DECREF((PyObject *) out); … … 303 306 return NULL; 304 307 tmp2 = PyUnicode_Concat(tmp, other); 305 308 } 306 if (tmp2 == NULL) {307 Py_DECREF(tmp);309 Py_DECREF(tmp); 310 if (tmp2 == NULL) 308 311 return NULL; 309 }310 Py_DECREF(tmp);311 312 args = PyTuple_New(1); 312 313 if (args == NULL) { 313 314 Py_DECREF(tmp2); … … 380 381 if (unicode == NULL) return NULL; 381 382 result = PyNumber_Multiply(unicode, self); 382 383 } 384 Py_DECREF(unicode); 383 385 384 386 if (result == NULL) return NULL; 385 387 args = PyTuple_New(1); … … 402 404 format = PyString_FromString("<Markup %r>"); 403 405 if (format == NULL) return NULL; 404 406 result = PyObject_Unicode(self); 405 if (result == NULL) return NULL; 407 if (result == NULL) { 408 Py_DECREF(format); 409 return NULL; 410 } 406 411 args = PyTuple_New(1); 407 412 if (args == NULL) { 413 Py_DECREF(format); 408 414 Py_DECREF(result); 409 415 return NULL; 410 416 }
