From 247b5154ac37c2069d48fc500f06f06ff6763fa1 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Mon, 27 Aug 2007 03:22:50 +0000 Subject: [PATCH] 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. --- Objects/stringlib/string_format.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Objects/stringlib/string_format.h b/Objects/stringlib/string_format.h index 2799141f32a..4ae7e578f24 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);