Skip to content

Commit f2ad0ef

Browse files
committed
Call PyErr_NoMemory() on when PyMem_RawMalloc() returns NULL; typo ammount->amount
1 parent c42b64c commit f2ad0ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/remote_debug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,7 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
12631263
if (entry->data == NULL) {
12641264
entry->data = PyMem_RawMalloc(page_size);
12651265
if (entry->data == NULL) {
1266+
PyErr_NoMemory();
12661267
_set_debug_exception_cause(PyExc_MemoryError,
12671268
"Cannot allocate %zu bytes for page cache entry "
12681269
"during read from PID %d at address 0x%lx",
@@ -1272,7 +1273,7 @@ _Py_RemoteDebug_PagedReadRemoteMemory(proc_handle_t *handle,
12721273
}
12731274

12741275
if (_Py_RemoteDebug_ReadRemoteMemory(handle, page_base, page_size, entry->data) < 0) {
1275-
// Try to just copy the exact ammount as a fallback
1276+
// Try to just copy the exact amount as a fallback
12761277
PyErr_Clear();
12771278
goto fallback;
12781279
}

0 commit comments

Comments
 (0)