-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Here:
Lines 537 to 551 in af4329e
PyObject *ann_dict = PyDict_New(); | |
if (ann_dict == NULL) { | |
return NULL; | |
} | |
assert(PyTuple_GET_SIZE(ann_tuple) % 2 == 0); | |
for (Py_ssize_t i = 0; i < PyTuple_GET_SIZE(ann_tuple); i += 2) { | |
int err = PyDict_SetItem(ann_dict, | |
PyTuple_GET_ITEM(ann_tuple, i), | |
PyTuple_GET_ITEM(ann_tuple, i + 1)); | |
if (err < 0) { | |
return NULL; | |
} |
- We allocate
ann_dict
- If
PyDict_SetItem
fails, we returnNULL
- We don't deallocate the dict
I will send a PR.
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error