]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
This adds a leak, but fixes a crash. The leaking code is:
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 27 Aug 2007 03:22:50 +0000 (03:22 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 27 Aug 2007 03:22:50 +0000 (03:22 +0000)
  "{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

index 2799141f32a95145d4464bf15e1950769d5bac78..4ae7e578f24b111657fb72a59846bedf9f10cc3c 100644 (file)
@@ -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);