FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-145376: Fix various reference leaks by JelleZijlstra · Pull Request #145377 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (5) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix reference leaks in various unusual error scenarios.
1 change: 1 addition & 0 deletions Modules/main.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ pymain_run_interactive_hook(int *exitcode)
}

if (PySys_Audit("cpython.run_interactivehook", "O", hook) < 0) {
Py_DECREF(hook);
goto error;
}

Expand Down
1 change: 1 addition & 0 deletions Python/crossinterp.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ check_missing___main___attr(PyObject *exc)
// Get the error message.
PyObject *args = PyException_GetArgs(exc);
if (args == NULL || args == Py_None || PyObject_Size(args) < 1) {
Py_XDECREF(args);
assert(!PyErr_Occurred());
return 0;
}
Comment thread
sobolevn marked this conversation as resolved.
Expand Down
1 change: 1 addition & 0 deletions Python/import.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -5638,6 +5638,7 @@ _imp__set_lazy_attributes_impl(PyObject *module, PyObject *modobj,

module_dict = get_mod_dict(modobj);
if (module_dict == NULL || !PyDict_CheckExact(module_dict)) {
Py_DECREF(lazy_submodules);
goto done;
}

Expand Down
1 change: 1 addition & 0 deletions Python/pythonrun.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,7 @@ _PyErr_Display(PyObject *file, PyObject *unused, PyObject *value, PyObject *tb)
"traceback",
"_print_exception_bltin");
if (print_exception_fn == NULL || !PyCallable_Check(print_exception_fn)) {
Py_XDECREF(print_exception_fn);
goto fallback;
}

Expand Down
2 changes: 1 addition & 1 deletion Python/sysmodule.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ sys_getwindowsversion_impl(PyObject *module)
PyObject *realVersion = _sys_getwindowsversion_from_kernel32();
if (!realVersion) {
if (!PyErr_ExceptionMatches(PyExc_WindowsError)) {
return NULL;
goto error;
}

PyErr_Clear();
Expand Down
Loading

Back | FazBrowse Home | New Git URL