Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cac17b4

Browse files
committed
Merge.
2 parents 75b8426 + 409f902 commit cac17b4

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
14+
1315
- Issue #18038: SyntaxError raised during compilation sources with illegal
1416
encoding now always contains an encoding name.
1517

Python/dynload_win.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname,
262262
theLength));
263263
}
264264
if (message != NULL) {
265-
PyErr_SetImportError(message, PyUnicode_FromString(shortname),
266-
pathname);
265+
PyObject *shortname_obj = PyUnicode_FromString(shortname);
266+
PyErr_SetImportError(message, shortname_obj, pathname);
267+
Py_XDECREF(shortname_obj);
267268
Py_DECREF(message);
268269
}
269270
return NULL;

0 commit comments

Comments
 (0)