aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2006-02-20 01:19:15 +0000
committerRichard M. Stallman2006-02-20 01:19:15 +0000
commit7b1d7d664bf0342b32fb1175d418e5bef2311310 (patch)
treea9dcf762ed545373c1e0b06ae11f64d82d729cfb /src
parent5eeafdc912bb0893b6b59be970edfd15afe7d10d (diff)
downloademacs-7b1d7d664bf0342b32fb1175d418e5bef2311310.tar.gz
emacs-7b1d7d664bf0342b32fb1175d418e5bef2311310.zip
(regex_compile): Call xmalloc and xrealloc.
(regcomp): Use xmalloc.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/regex.c16
2 files changed, 16 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7da4cd5e5bf..2e177ecbe7b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
12006-02-19 Richard M. Stallman <rms@gnu.org> 12006-02-19 Richard M. Stallman <rms@gnu.org>
2 2
3 * xterm.c (x_catch_errors): Use xmalloc.
4
5 * regex.c (extend_range_table_work_area): Call xmalloc and xrealloc.
6 (regex_compile): Likewise.
7 (regcomp): Use xmalloc.
8
9 * gtkutil.c (malloc_widget_value): Use xmalloc.
10
3 * vm-limit.c [HAVE_GETRLIMIT]: Include sys/resource.h. 11 * vm-limit.c [HAVE_GETRLIMIT]: Include sys/resource.h.
4 (check_memory_limits) [HAVE_GETRLIMIT]: Use getrlimit. 12 (check_memory_limits) [HAVE_GETRLIMIT]: Use getrlimit.
5 13
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)
3608 3608
3609 if (! fail_stack.stack) 3609 if (! fail_stack.stack)
3610 fail_stack.stack 3610 fail_stack.stack
3611 = (fail_stack_elt_t *) malloc (fail_stack.size 3611 = (fail_stack_elt_t *) xmalloc (fail_stack.size
3612 * sizeof (fail_stack_elt_t)); 3612 * sizeof (fail_stack_elt_t));
3613 else 3613 else
3614 fail_stack.stack 3614 fail_stack.stack
3615 = (fail_stack_elt_t *) realloc (fail_stack.stack, 3615 = (fail_stack_elt_t *) xrealloc (fail_stack.stack,
3616 (fail_stack.size 3616 (fail_stack.size
3617 * sizeof (fail_stack_elt_t))); 3617 * sizeof (fail_stack_elt_t)));
3618 } 3618 }
3619 3619
3620 regex_grow_registers (num_regs); 3620 regex_grow_registers (num_regs);
@@ -6292,15 +6292,15 @@ regcomp (preg, pattern, cflags)
6292 preg->used = 0; 6292 preg->used = 0;
6293 6293
6294 /* Try to allocate space for the fastmap. */ 6294 /* Try to allocate space for the fastmap. */
6295 preg->fastmap = (char *) malloc (1 << BYTEWIDTH); 6295 preg->fastmap = (char *) xmalloc (1 << BYTEWIDTH);
6296 6296
6297 if (cflags & REG_ICASE) 6297 if (cflags & REG_ICASE)
6298 { 6298 {
6299 unsigned i; 6299 unsigned i;
6300 6300
6301 preg->translate 6301 preg->translate
6302 = (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE 6302 = (RE_TRANSLATE_TYPE) xmalloc (CHAR_SET_SIZE
6303 * sizeof (*(RE_TRANSLATE_TYPE)0)); 6303 * sizeof (*(RE_TRANSLATE_TYPE)0));
6304 if (preg->translate == NULL) 6304 if (preg->translate == NULL)
6305 return (int) REG_ESPACE; 6305 return (int) REG_ESPACE;
6306 6306