bpo-38138: Fix memory leak introduced by interned strings (GH-16053)
authorDino Viehland <dinoviehland@fb.com>
Thu, 12 Sep 2019 14:38:13 +0000 (15:38 +0100)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 12 Sep 2019 14:38:13 +0000 (07:38 -0700)
Interned string needs to be decref'd

https://bugs.python.org/issue38138

Automerge-Triggered-By: @matrixise
Python/ast.c

index 46815c271b62d5ab174adf928237126f6639f9e6..e6f71671c18e75c344fd3265db8799827fcb2f81 100644 (file)
@@ -630,6 +630,7 @@ new_identifier(const char *n, struct compiling *c)
         PyObject *args[2] = {form, id};
         id2 = _PyObject_FastCall(c->c_normalize, args, 2);
         Py_DECREF(id);
+        Py_DECREF(form);
         if (!id2)
             return NULL;
         if (!PyUnicode_Check(id2)) {