Issue 13085: Fix some memory leaks. Patch by Stefan Krah.

This commit is contained in:
Martin v. Löwis 2011-10-01 16:35:40 +02:00
parent 5c0fb00ad8
commit 0b1d348990
2 changed files with 20 additions and 11 deletions

View file

@ -9075,6 +9075,7 @@ replace(PyObject *self, PyObject *str1,
PyUnicode_KIND_SIZE(rkind, slen-i));
}
u = PyUnicode_FromKindAndData(rkind, res, new_size);
PyMem_Free(res);
}
if (srelease)
PyMem_FREE(sbuf);