Avoid segfaults in replace-buffer-contents with large buffers
* src/editfns.c (Freplace_buffer_contents): Don't release malloc'ed memory as long as we are using it. (Bug#31888)
This commit is contained in:
parent
d22b8d1ad1
commit
d6aa55e2b4
1 changed files with 3 additions and 2 deletions
|
@ -3215,7 +3215,6 @@ buffer stay intact. */)
|
||||||
/* Since we didn’t define EARLY_ABORT, we should never abort
|
/* Since we didn’t define EARLY_ABORT, we should never abort
|
||||||
early. */
|
early. */
|
||||||
eassert (! early_abort);
|
eassert (! early_abort);
|
||||||
SAFE_FREE ();
|
|
||||||
|
|
||||||
Fundo_boundary ();
|
Fundo_boundary ();
|
||||||
ptrdiff_t count = SPECPDL_INDEX ();
|
ptrdiff_t count = SPECPDL_INDEX ();
|
||||||
|
@ -3261,8 +3260,10 @@ buffer stay intact. */)
|
||||||
--i;
|
--i;
|
||||||
--j;
|
--j;
|
||||||
}
|
}
|
||||||
|
unbind_to (count, Qnil);
|
||||||
|
SAFE_FREE ();
|
||||||
|
|
||||||
return unbind_to (count, Qnil);
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue