From: Neal Norwitz Date: Mon, 27 Aug 2007 03:22:50 +0000 (+0000) Subject: This adds a leak, but fixes a crash. The leaking code is: X-Git-Tag: v3.0a1~217 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=247b5154ac37c2069d48fc500f06f06ff6763fa1;p=thirdparty%2FPython%2Fcpython.git This adds a leak, but fixes a crash. The leaking code is: "{0:.{precision}s}".format('hello world', precision=5) I pretty sure it's because of the 'precision' keyword. Still need to investigate further. --- diff --git a/Objects/stringlib/string_format.h b/Objects/stringlib/string_format.h index 2799141f32a9..4ae7e578f24b 100644 --- a/Objects/stringlib/string_format.h +++ b/Objects/stringlib/string_format.h @@ -416,6 +416,7 @@ get_field_object(SubString *input, PyObject *args, PyObject *kwargs) Py_DECREF(key); goto error; } + Py_INCREF(obj); } else { /* look up in args */ obj = PySequence_GetItem(args, index);