emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recent change in filio.c causes crashes


From: Stefan Monnier
Subject: Recent change in filio.c causes crashes
Date: Thu, 28 Jun 2007 10:36:06 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

The change below causes crashes under my Debian testing version of
GNU/Linux, where glibc complains about double-free in fclose.

The commit log only mentions the docstring change, but not the code change,
so I presume the code change was a simple oversight (the stream is already
properly closed from an unwind handler), but I'd rather have your opinion
before reverting it.


        Stefan


revision 1.582
date: 2007-06-27 19:30:02 -0400;  author: rms;  state: Exp;  lines: +5 -2;  
commitid: bXZP137DmjaWIBns;
(syms_of_fileio) <after-insert-file-functions>: Doc fix.
----------------------------


Index: src/fileio.c
===================================================================
RCS file: /sources/emacs/emacs/src/fileio.c,v
retrieving revision 1.581
retrieving revision 1.582
diff -u -r1.581 -r1.582
--- src/fileio.c        8 Jun 2007 20:12:52 -0000       1.581
+++ src/fileio.c        27 Jun 2007 23:30:02 -0000      1.582
@@ -6021,6 +6021,8 @@
 
   /* Prevent another auto save till enough input events come in.  */
   record_auto_save ();
+  if (stream != NULL)
+    fclose (stream);
 
   if (auto_saved && NILP (no_message))
     {
@@ -6683,8 +6685,9 @@
 
   DEFVAR_LISP ("after-insert-file-functions", &Vafter_insert_file_functions,
               doc: /* A list of functions to be called at the end of 
`insert-file-contents'.
-Each is passed one argument, the number of characters inserted.
-It should return the new character count, and leave point the same.
+Each is passed one argument, the number of characters inserted,
+with point at the start of the inserted text.  Each function
+should leave point the same, and return the new character count.
 If `insert-file-contents' is intercepted by a handler from
 `file-name-handler-alist', that handler is responsible for calling the
 functions in `after-insert-file-functions' if appropriate.  */);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]