[Python-checkins] cpython: Fixed memory leak in error branch of formatfloat(). CID 719687
christian.heimes
python-checkins at python.org
Mon Sep 10 11:48:50 CEST 2012
http://hg.python.org/cpython/rev/a3e194661b5f
changeset: 78947:a3e194661b5f
user: Christian Heimes <christian at cheimes.de>
date: Mon Sep 10 11:48:41 2012 +0200
summary:
Fixed memory leak in error branch of formatfloat(). CID 719687
files:
Objects/unicodeobject.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -13238,8 +13238,10 @@
return -1;
len = strlen(p);
if (writer) {
- if (_PyUnicodeWriter_Prepare(writer, len, 127) == -1)
+ if (_PyUnicodeWriter_Prepare(writer, len, 127) == -1) {
+ PyMem_Free(p);
return -1;
+ }
unicode_write_cstr(writer->buffer, writer->pos, p, len);
writer->pos += len;
}
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list