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
Prev Previous commit
Next Next commit
Raise MemoryError where appropriate.
  • Loading branch information
ericsnowcurrently committed Jul 28, 2023
commit 430716b1b27f5ead37fc6d765e68292d0f401cba
3 changes: 3 additions & 0 deletions Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ hashtable_key_from_2_strings(PyObject *str1, PyObject *str2, const char sep)

char *key = PyMem_RawMalloc(size);
if (key == NULL) {
PyErr_NoMemory();
return NULL;
}

Expand Down Expand Up @@ -994,6 +995,7 @@ _extensions_cache_set(PyObject *filename, PyObject *name, PyModuleDef *def)
&alloc
);
if (EXTENSIONS.hashtable == NULL) {
PyErr_NoMemory();
goto finally;
}
}
Expand All @@ -1008,6 +1010,7 @@ _extensions_cache_set(PyObject *filename, PyObject *name, PyModuleDef *def)
if (entry == NULL) {
if (_Py_hashtable_set(EXTENSIONS.hashtable, key, Py_NewRef(def)) < 0) {
PyMem_RawFree(key);
PyErr_NoMemory();
goto finally;
}
}
Expand Down