]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-109216: Fix possible memory leak in `BUILD_MAP` (#109257)
authorNikita Sobolev <mail@sobolevn.me>
Tue, 12 Sep 2023 09:37:22 +0000 (12:37 +0300)
committerGitHub <noreply@github.com>
Tue, 12 Sep 2023 09:37:22 +0000 (15:07 +0530)
Misc/NEWS.d/next/Core and Builtins/2023-09-11-12-41-42.gh-issue-109216.60QOSb.rst [new file with mode: 0644]
Python/bytecodes.c
Python/executor_cases.c.h
Python/generated_cases.c.h

diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-09-11-12-41-42.gh-issue-109216.60QOSb.rst b/Misc/NEWS.d/next/Core and Builtins/2023-09-11-12-41-42.gh-issue-109216.60QOSb.rst
new file mode 100644 (file)
index 0000000..aa8b283
--- /dev/null
@@ -0,0 +1 @@
+Fix possible memory leak in :opcode:`BUILD_MAP`.
index 7c49f9a8cc74b12285997062e7f64c4c8578146b..08d91b5efe51be58a56206f31c6cdb91478f73a6 100644 (file)
@@ -1600,9 +1600,6 @@ dummy_func(
                     values, 2,
                     values+1, 2,
                     oparg);
-            if (map == NULL)
-                goto error;
-
             DECREF_INPUTS();
             ERROR_IF(map == NULL, error);
         }
index a4d813056aa9f6ed9bdbd7d00b4f3a5f79644cf9..8f3febe7d1ab956901050572c88bcb727bb9b7c7 100644 (file)
                     values, 2,
                     values+1, 2,
                     oparg);
-            if (map == NULL)
-                goto error;
-
             for (int _i = oparg*2; --_i >= 0;) {
                 Py_DECREF(values[_i]);
             }
index 27cda1f03da68f96a7cc369b61bbed288fc72020..b86e35f84fda097e01151dee1a04e11f0a193bd2 100644 (file)
                     values, 2,
                     values+1, 2,
                     oparg);
-            if (map == NULL)
-                goto error;
-
             for (int _i = oparg*2; --_i >= 0;) {
                 Py_DECREF(values[_i]);
             }