Mercurial > emacs
changeset 69028:9121701fb79d
(regex_compile): Call xmalloc and xrealloc.
(regcomp): Use xmalloc.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 20 Feb 2006 01:19:08 +0000 |
parents | b8d7bffaf333 |
children | 9021ca41a840 |
files | src/regex.c |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/regex.c Mon Feb 20 01:18:43 2006 +0000 +++ b/src/regex.c Mon Feb 20 01:19:08 2006 +0000 @@ -3608,13 +3608,13 @@ 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 @@ 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;