Commit ea8a7d00 authored by Paul Eggert's avatar Paul Eggert
Browse files

* minibuf.c (read_minibuf_noninteractive): Don't leak memory

on memory overflow.
parent c86960f0
2011-07-29 Paul Eggert <eggert@cs.ucla.edu>
* minibuf.c (read_minibuf_noninteractive): Don't leak memory
on memory overflow.
* macros.c: Integer and memory overflow fixes.
(Fstart_kbd_macro): Don't update size until alloc done.
(store_kbd_macro_char): Reorder multiplicands to avoid overflow.
......
......@@ -261,7 +261,10 @@ read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
if (len == size)
{
if (STRING_BYTES_BOUND / 2 < size)
memory_full (SIZE_MAX);
{
xfree (line);
memory_full (SIZE_MAX);
}
size *= 2;
line = (char *) xrealloc (line, size);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment