aboutsummaryrefslogtreecommitdiffstats
path: root/src/regex.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2006-02-20 01:19:15 +0000
committerRichard M. Stallman <[email protected]>2006-02-20 01:19:15 +0000
commit7b1d7d664bf0342b32fb1175d418e5bef2311310 (patch)
treea9dcf762ed545373c1e0b06ae11f64d82d729cfb /src/regex.c
parent5eeafdc912bb0893b6b59be970edfd15afe7d10d (diff)
(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 ada7877021..d6b61a1c18 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;