Commit 535cdd71 authored by Neal Norwitz's avatar Neal Norwitz

Try to handle a malloc failure. I'm not entirely sure this is correct.

There might be something else we need to do to handle the exception.

Klocwork # 212-213
parent ebefd34a
......@@ -1166,6 +1166,9 @@ entrance:
/* install new repeat context */
ctx->u.rep = (SRE_REPEAT*) PyObject_MALLOC(sizeof(*ctx->u.rep));
/* XXX(nnorwitz): anything else we need to do on error? */
if (!ctx->u.rep)
RETURN_FAILURE;
ctx->u.rep->count = -1;
ctx->u.rep->pattern = ctx->pattern;
ctx->u.rep->prev = state->repeat;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment