]> git.eshelyaron.com Git - emacs.git/commitdiff
(regex_compile): Call xmalloc and xrealloc.
authorRichard M. Stallman <rms@gnu.org>
Mon, 20 Feb 2006 01:19:15 +0000 (01:19 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 20 Feb 2006 01:19:15 +0000 (01:19 +0000)
(regcomp): Use xmalloc.

src/ChangeLog
src/regex.c

index 7da4cd5e5bf158eb46cb694c2641214518fb25d5..2e177ecbe7bdb7b5aa6f8f31ed01d0f94083a811 100644 (file)
@@ -1,5 +1,13 @@
 2006-02-19  Richard M. Stallman  <rms@gnu.org>
 
+       * 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.
 
index ada7877021115ec5ef88b245bbf4e0e07c53391a..d6b61a1c18b949f36dc790afe38c9da5b02a8e3b 100644 (file)
@@ -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;