From: Andrea Corallo Date: Thu, 11 Jun 2020 21:24:00 +0000 (+0200) Subject: * Fix memory leak when native compiled function is collected X-Git-Tag: emacs-28.0.90~2727^2~569 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ab78ed83b977084885265a1842e4e474e0938d9f;p=emacs.git * Fix memory leak when native compiled function is collected * src/alloc.c (cleanup_vector): Handle native compiled functions. --- diff --git a/src/alloc.c b/src/alloc.c index 9a9dbb52e7b..750ffbd2dd8 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3156,6 +3156,17 @@ cleanup_vector (struct Lisp_Vector *vector) PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit); dispose_comp_unit (cu, true); } + else if (NATIVE_COMP_FLAG + && PSEUDOVECTOR_TYPEP (&vector->header, PVEC_SUBR)) + { + struct Lisp_Subr *subr = + PSEUDOVEC_STRUCT (vector, Lisp_Subr); + if (subr->native_comp_u[0]) + { + xfree (subr->symbol_name); + xfree (subr->native_c_name[0]); + } + } } /* Reclaim space used by unmarked vectors. */