Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Python/coreconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ _Py_wstrlist_copy(int len, wchar_t **list)
assert((len > 0 && list != NULL) || len == 0);
size_t size = len * sizeof(list[0]);
wchar_t **list_copy = PyMem_RawMalloc(size);
if (list_copy == NULL) {
return NULL;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another bug below: _Py_wstrlist_clear(i, list), it should be list_copy, not list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

for (int i=0; i < len; i++) {
wchar_t* arg = _PyMem_RawWcsdup(list[i]);
if (arg == NULL) {
Expand Down