]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-122229: Add missing `Py_DECREF` in `func_get_annotation_dict` (#122230)
authorsobolevn <mail@sobolevn.me>
Wed, 24 Jul 2024 12:47:52 +0000 (15:47 +0300)
committerGitHub <noreply@github.com>
Wed, 24 Jul 2024 12:47:52 +0000 (05:47 -0700)
Objects/funcobject.c

index 40211297be20c06e7a56d89f150dadf457fce9dd..8df0da800980a9276084b56b4c08f4fc3ac1afcc 100644 (file)
@@ -547,6 +547,7 @@ func_get_annotation_dict(PyFunctionObject *op)
                                      PyTuple_GET_ITEM(ann_tuple, i + 1));
 
             if (err < 0) {
+                Py_DECREF(ann_dict);
                 return NULL;
             }
         }