From: Nikita Sobolev Date: Tue, 12 Sep 2023 09:37:22 +0000 (+0300) Subject: gh-109216: Fix possible memory leak in `BUILD_MAP` (#109257) X-Git-Tag: v3.13.0a1~471 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=247ee1bf841524667f883ebba5e343101f609026;p=thirdparty%2FPython%2Fcpython.git gh-109216: Fix possible memory leak in `BUILD_MAP` (#109257) --- 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 index 000000000000..aa8b2832af23 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-09-11-12-41-42.gh-issue-109216.60QOSb.rst @@ -0,0 +1 @@ +Fix possible memory leak in :opcode:`BUILD_MAP`. diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 7c49f9a8cc74..08d91b5efe51 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -1600,9 +1600,6 @@ dummy_func( values, 2, values+1, 2, oparg); - if (map == NULL) - goto error; - DECREF_INPUTS(); ERROR_IF(map == NULL, error); } diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index a4d813056aa9..8f3febe7d1ab 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -1433,9 +1433,6 @@ values, 2, values+1, 2, oparg); - if (map == NULL) - goto error; - for (int _i = oparg*2; --_i >= 0;) { Py_DECREF(values[_i]); } diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 27cda1f03da6..b86e35f84fda 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -2077,9 +2077,6 @@ values, 2, values+1, 2, oparg); - if (map == NULL) - goto error; - for (int _i = oparg*2; --_i >= 0;) { Py_DECREF(values[_i]); }