From: Richard M. Stallman Date: Mon, 20 Feb 2006 01:19:15 +0000 (+0000) Subject: (regex_compile): Call xmalloc and xrealloc. X-Git-Tag: emacs-pretest-22.0.90~4010 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7b1d7d664bf0342b32fb1175d418e5bef2311310;p=emacs.git (regex_compile): Call xmalloc and xrealloc. (regcomp): Use xmalloc. --- diff --git a/src/ChangeLog b/src/ChangeLog index 7da4cd5e5bf..2e177ecbe7b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2006-02-19 Richard M. Stallman + * xterm.c (x_catch_errors): Use xmalloc. + + * regex.c (extend_range_table_work_area): Call xmalloc and xrealloc. + (regex_compile): Likewise. + (regcomp): Use xmalloc. + + * gtkutil.c (malloc_widget_value): Use xmalloc. + * vm-limit.c [HAVE_GETRLIMIT]: Include sys/resource.h. (check_memory_limits) [HAVE_GETRLIMIT]: Use getrlimit. 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;