Fix a crash, when there's no memory left on a device,
-which happened in:
-
-- code compilation
-- :func:`!_winapi.CreateProcess`
+which happened in: code compilation, :mod:`!_interpchannels` module,
+:func:`!_winapi.CreateProcess` function.
Now these places raise proper :exc:`MemoryError` errors.
_channelends_new(void)
{
_channelends *ends = GLOBAL_MALLOC(_channelends);
- if (ends== NULL) {
+ if (ends == NULL) {
+ PyErr_NoMemory();
return NULL;
}
ends->numsendopen = 0;
assert(check_unbound(defaults.unboundop));
_channel_state *chan = GLOBAL_MALLOC(_channel_state);
if (chan == NULL) {
+ PyErr_NoMemory();
return NULL;
}
chan->mutex = mutex;
{
_channelref *ref = GLOBAL_MALLOC(_channelref);
if (ref == NULL) {
+ PyErr_NoMemory();
return NULL;
}
ref->cid = cid;
}
chan->closing = GLOBAL_MALLOC(struct _channel_closing);
if (chan->closing == NULL) {
+ PyErr_NoMemory();
goto done;
}
chan->closing->ref = ref;