mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
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
This commit is contained in:
parent
9cd3c34b6a
commit
ef0de023db
1 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue