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.
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);
}