GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Memory leak in `atexit.register()`: missing `Py_DECREF` for `func_args` tuple · Issue #144986 · python/cpython Closed Labels 3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug description
Additionally, there is no NULL check after // Modules/atexitmodule.c, atexit_register() PyObject *func_args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); // BUG 1: missing NULL check PyObject *func_kwargs = kwargs; ... PyObject *callback = PyTuple_Pack(3, func, func_args, func_kwargs); // BUG 2: missing Py_DECREF(func_args) — leaks the tuple The leak is detected by AddressSanitizer/LeakSanitizer when running Fix: PyObject *func_args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); if (func_args == NULL) { return NULL; } ... PyObject *callback = PyTuple_Pack(3, func, func_args, func_kwargs); Py_DECREF(func_args); CPython versions tested onCPython main branch Operating systems tested onLinux Linked PRsActivity
MetadataMetadataAssigneesLabels3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |