summaryrefslogtreecommitdiff
path: root/src/regex.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-02-20 01:19:08 +0000
committerRichard M. Stallman <rms@gnu.org>2006-02-20 01:19:08 +0000
commitb735100392cdb3d078dfb108450dd1b4b73c75e2 (patch)
tree21aca279f1803c395327a6c680cb3826c7916281 /src/regex.c
parent1abe59e0328457b98772d1bf83e7afe981abcb72 (diff)
downloademacs-b735100392cdb3d078dfb108450dd1b4b73c75e2.tar.gz
(regex_compile): Call xmalloc and xrealloc.
(regcomp): Use xmalloc.
Diffstat (limited to 'src/regex.c')
-rw-r--r--src/regex.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/regex.c b/src/regex.c
index ada78770211..d6b61a1c18b 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -3608,13 +3608,13 @@ regex_compile (pattern, size, syntax, bufp)
if (! fail_stack.stack)
fail_stack.stack
- = (fail_stack_elt_t *) malloc (fail_stack.size
- * sizeof (fail_stack_elt_t));
+ = (fail_stack_elt_t *) xmalloc (fail_stack.size
+ * sizeof (fail_stack_elt_t));
else
fail_stack.stack
- = (fail_stack_elt_t *) realloc (fail_stack.stack,
- (fail_stack.size
- * sizeof (fail_stack_elt_t)));
+ = (fail_stack_elt_t *) xrealloc (fail_stack.stack,
+ (fail_stack.size
+ * sizeof (fail_stack_elt_t)));
}
regex_grow_registers (num_regs);
@@ -6292,15 +6292,15 @@ regcomp (preg, pattern, cflags)
preg->used = 0;
/* Try to allocate space for the fastmap. */
- preg->fastmap = (char *) malloc (1 << BYTEWIDTH);
+ preg->fastmap = (char *) xmalloc (1 << BYTEWIDTH);
if (cflags & REG_ICASE)
{
unsigned i;
preg->translate
- = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE
- * sizeof (*(RE_TRANSLATE_TYPE)0));
+ = (RE_TRANSLATE_TYPE) xmalloc (CHAR_SET_SIZE
+ * sizeof (*(RE_TRANSLATE_TYPE)0));
if (preg->translate == NULL)
return (int) REG_ESPACE;