leading to a memory leak, possible in functions like
load_charset_map_from_file that can allocate an unbounded number
of objects.
2011-03-22 Paul Eggert <eggert@cs.ucla.edu>
+ * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
+ leading to a memory leak, possible in functions like
+ load_charset_map_from_file that can allocate an unbounded number
+ of objects.
+
* xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
that could (at least in theory) be that large.
else \
{ \
buf = (type) xmalloc (size); \
- sa_must_free++; \
+ sa_must_free = 1; \
record_unwind_protect (safe_alloca_unwind, \
make_save_value (buf, 0)); \
} \
buf = (Lisp_Object *) xmalloc (size_); \
arg_ = make_save_value (buf, nelt); \
XSAVE_VALUE (arg_)->dogc = 1; \
- sa_must_free++; \
+ sa_must_free = 1; \
record_unwind_protect (safe_alloca_unwind, arg_); \
} \
} while (0)