Commit 3fdf12ca authored by Eli Zaretskii's avatar Eli Zaretskii

(Fload): Don't leak the file descriptor returned by openp if we are going

to signal an error.
parent 7559f399
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.
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment