# HG changeset patch # User michaels # Date 1028191128 0 # Node ID 7924b28c57a4418c5cc287bccab8e1241fc0113b # Parent d7603d225813a7c5a1e28ca14a4a624fa1771321 [xemacs-hg @ 2002-08-01 08:38:32 by michaels] 2002-07-31 Didier Verna * file-coding.c (make_coding_system_1): Add missing call to `xfree (newname)'. * fix memory leak introduced by 2002-04-14 Ben Wing : alloc.c (Fmake_byte_code): don't xnew_array of size 0. (sweep_compiled_functions): define ADDITIONAL_FREE_compiled_function to free the args field when needed. diff -r d7603d225813 -r 7924b28c57a4 src/ChangeLog --- a/src/ChangeLog Thu Aug 01 08:33:11 2002 +0000 +++ b/src/ChangeLog Thu Aug 01 08:38:48 2002 +0000 @@ -1,3 +1,14 @@ +2002-07-31 Didier Verna + + * file-coding.c (make_coding_system_1): Add missing call to + `xfree (newname)'. + + * fix memory leak introduced by + 2002-04-14 Ben Wing : + alloc.c (Fmake_byte_code): don't xnew_array of size 0. + (sweep_compiled_functions): define ADDITIONAL_FREE_compiled_function + to free the args field when needed. + 2002-07-31 David Bush * eldap.c: Add the dumpable-flag to the USE_KKCC version of diff -r d7603d225813 -r 7924b28c57a4 src/alloc.c --- a/src/alloc.c Thu Aug 01 08:33:11 2002 +0000 +++ b/src/alloc.c Thu Aug 01 08:38:48 2002 +0000 @@ -1537,7 +1537,8 @@ } } - f->args = xnew_array (Lisp_Object, totalargs); + if (totalargs) + f->args = xnew_array (Lisp_Object, totalargs); { LIST_LOOP_2 (arg, arglist) @@ -3621,7 +3622,8 @@ sweep_compiled_functions (void) { #define UNMARK_compiled_function(ptr) UNMARK_RECORD_HEADER (&((ptr)->lheader)) -#define ADDITIONAL_FREE_compiled_function(ptr) +#define ADDITIONAL_FREE_compiled_function(ptr) \ + if (ptr->args_in_array) xfree (ptr->args) SWEEP_FIXED_TYPE_BLOCK (compiled_function, Lisp_Compiled_Function); } diff -r d7603d225813 -r 7924b28c57a4 src/file-coding.c --- a/src/file-coding.c Thu Aug 01 08:33:11 2002 +0000 +++ b/src/file-coding.c Thu Aug 01 08:38:48 2002 +0000 @@ -1176,6 +1176,7 @@ newname = emacs_sprintf_malloc (NULL, "Int%d", coding_system_tick); defmnem = build_intstring (newname); + xfree (newname); } else CHECK_SYMBOL (name_or_existing);