summaryrefslogtreecommitdiffstats
path: root/Modules/regexpr.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-05 13:44:50 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-05 13:44:50 (GMT)
commitc65a525cdc9ce2e0af56e1a75deb877e935cee2f (patch)
tree3d9826ef689cd442f8906c2fed6b8eed008b4acc /Modules/regexpr.c
parent781db5d0bb24889dbcd06203b38d4eb886d45f87 (diff)
downloadcpython-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.c7
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);
}