bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. (GH-11015) (GH-11020)
(cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
diff --git a/PC/launcher.c b/PC/launcher.c
index 0242f26..4c620da 100644
--- a/PC/launcher.c
+++ b/PC/launcher.c
@@ -1763,6 +1763,9 @@
}
cch += (DWORD)wcslen(PYTHON_EXECUTABLE) + 1 + 1; /* include sep and null */
executable = (wchar_t *)malloc(cch * sizeof(wchar_t));
+ if (executable == NULL) {
+ error(RC_NO_MEMORY, L"A memory allocation failed");
+ }
cch_actual = MultiByteToWideChar(CP_UTF8, 0, start, len, executable, cch);
if (!cch_actual) {
error(RC_BAD_VENV_CFG, L"Cannot decode home path in '%ls'",