From: Gerd Moellmann Date: Fri, 21 Jul 2000 14:33:35 +0000 (+0000) Subject: (Fprevious_overlay_change): Avoid memory leak. X-Git-Tag: emacs-pretest-21.0.90~2698 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=017f053958aa10e4d25edc5a327c61cdd8e16c23;p=emacs.git (Fprevious_overlay_change): Avoid memory leak. --- diff --git a/src/buffer.c b/src/buffer.c index e7f6db096fd..120392cebba 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -3613,14 +3613,14 @@ If there are no more overlay boundaries before POS, return (point-min).") CHECK_NUMBER_COERCE_MARKER (pos, 0); - len = 10; - overlay_vec = (Lisp_Object *) xmalloc (len * sizeof (Lisp_Object)); - /* At beginning of buffer, we know the answer; avoid bug subtracting 1 below. */ if (XINT (pos) == BEGV) return pos; + len = 10; + overlay_vec = (Lisp_Object *) xmalloc (len * sizeof (Lisp_Object)); + /* Put all the overlays we want in a vector in overlay_vec. Store the length in len. prevpos gets the position of the previous change. */