]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fload): Don't leak the file descriptor returned by openp if we are going
authorEli Zaretskii <eliz@gnu.org>
Fri, 20 Jan 2006 19:54:07 +0000 (19:54 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 20 Jan 2006 19:54:07 +0000 (19:54 +0000)
to signal an error.

src/ChangeLog
src/lread.c

index 51b607477c6e503784c2d8a14b4a5470e2932104..a67b97bc3701a8f8a2bead08f2da643c23313f43 100644 (file)
@@ -1,5 +1,8 @@
 2006-01-20  Eli Zaretskii  <eliz@gnu.org>
 
+       * lread.c (Fload): Don't leak the file descriptor returned by
+       openp if we are going to signal an error.
+
        * w32.c (sys_close): If FD is outside [0..MAXDESC) limits, pass it
        directly to _close.
        (sys_dup): Protect against new_fd larger than fd_info[] can handle.
index 4d9ddfbd0092dac0efd2a7e4b4b57da2cae26392..7be2ad8fa9b1b2e142902dec5d650efe7782efb8 100644 (file)
@@ -801,8 +801,12 @@ Return t if file exists.  */)
       if (!NILP (Fequal (found, XCAR (tem))))
        count++;
     if (count > 3)
-      Fsignal (Qerror, Fcons (build_string ("Recursive load"),
-                             Fcons (found, Vloads_in_progress)));
+      {
+       if (fd >= 0)
+         emacs_close (fd);
+       Fsignal (Qerror, Fcons (build_string ("Recursive load"),
+                               Fcons (found, Vloads_in_progress)));
+      }
     record_unwind_protect (record_load_unwind, Vloads_in_progress);
     Vloads_in_progress = Fcons (found, Vloads_in_progress);
   }