diff options
author | Guido van Rossum <guido@python.org> | 1994-08-05 13:44:50 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1994-08-05 13:44:50 (GMT) |
commit | c65a525cdc9ce2e0af56e1a75deb877e935cee2f (patch) | |
tree | 3d9826ef689cd442f8906c2fed6b8eed008b4acc /Modules/regexpr.c | |
parent | 781db5d0bb24889dbcd06203b38d4eb886d45f87 (diff) | |
download | cpython-c65a525cdc9ce2e0af56e1a75deb877e935cee2f.zip cpython-c65a525cdc9ce2e0af56e1a75deb877e935cee2f.tar.gz cpython-c65a525cdc9ce2e0af56e1a75deb877e935cee2f.tar.bz2 |
* Modules/{Setup.in,Makefile.pre.in}: renamed some modules to
shorter names (dropped the "module" from the name): sunaudiodev,
imgformat, audioop, imageop, imgfile
* Modules/stropmodule.c (strop_rindex): make rindex('abc', '') do
the right thing (i.e. return 3 instead of 0)
* Modules/socketmodule.c: disabled allowbroadcast() socket method
Diffstat (limited to 'Modules/regexpr.c')
-rw-r--r-- | Modules/regexpr.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/regexpr.c b/Modules/regexpr.c index f877558..841f500 100644 --- a/Modules/regexpr.c +++ b/Modules/regexpr.c @@ -1251,6 +1251,11 @@ regexp_registers_t regs; goto error; failure_stack_start = (struct failure_point *) malloc(MAX_FAILURES * sizeof(*failure_stack_start)); + if (failure_stack_start == NULL) + { + failure_stack_start = initial_failure_stack; + goto error; + } failure_stack_end = failure_stack_start + MAX_FAILURES; memcpy((char *)failure_stack_start, (char *)initial_failure_stack, INITIAL_FAILURES * sizeof(*failure_stack_start)); @@ -1529,6 +1534,8 @@ char *s; /* the buffer will be allocated automatically */ re_comp_buf.fastmap = malloc(256); re_comp_buf.translate = NULL; + if (re_comp_buf.fastmap == NULL) + return "Out of memory"; } return re_compile_pattern(s, strlen(s), &re_comp_buf); } |