8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6dc8f05 commit 388bd4bCopy full SHA for 388bd4b
Modules/main.c
@@ -1236,10 +1236,13 @@ copy_wstrlist(int len, wchar_t **list)
1236
assert((len > 0 && list != NULL) || len == 0);
1237
size_t size = len * sizeof(list[0]);
1238
wchar_t **list_copy = PyMem_RawMalloc(size);
1239
+ if (list_copy == NULL) {
1240
+ return NULL;
1241
+ }
1242
for (int i=0; i < len; i++) {
1243
wchar_t* arg = _PyMem_RawWcsdup(list[i]);
1244
if (arg == NULL) {
- clear_wstrlist(i, list);
1245
+ clear_wstrlist(i, list_copy);
1246
return NULL;
1247
}
1248
list_copy[i] = arg;
0 commit comments