commit | 110ac16b9f1be086ba98aa6f1ef8d7105493d92e | [log] [tgz] |
---|---|---|
author | Christian Heimes <christian@cheimes.de> | Mon Sep 10 02:51:27 2012 +0200 |
committer | Christian Heimes <christian@cheimes.de> | Mon Sep 10 02:51:27 2012 +0200 |
tree | 3553a5150e16604bdedda9c596c39513eaf9fb18 | |
parent | f03572d040f0f34b7fd3c1bcbd232d60b5a00d78 [diff] [blame] |
Fixed resource leak to scratch when _PyUnicodeWriter_Prepare fails
diff --git a/Objects/longobject.c b/Objects/longobject.c index 80fe724..7e12b34 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c
@@ -1628,8 +1628,10 @@ strlen++; } if (writer) { - if (_PyUnicodeWriter_Prepare(writer, strlen, '9') == -1) + if (_PyUnicodeWriter_Prepare(writer, strlen, '9') == -1) { + Py_DECREF(scratch); return -1; + } kind = writer->kind; str = NULL; }