diff options
| author | Eli Zaretskii | 2006-01-20 19:54:07 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2006-01-20 19:54:07 +0000 |
| commit | 3fdf12ca117212ddbddfef58ad908e8c6a6bbf4b (patch) | |
| tree | 5c98f33aab02896405b4b5d0ce254bcf0e63fe54 | |
| parent | 7559f399d1082a55db3193c668c0555433a59653 (diff) | |
| download | emacs-3fdf12ca117212ddbddfef58ad908e8c6a6bbf4b.tar.gz emacs-3fdf12ca117212ddbddfef58ad908e8c6a6bbf4b.zip | |
(Fload): Don't leak the file descriptor returned by openp if we are going
to signal an error.
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/lread.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 51b607477c6..a67b97bc370 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2006-01-20 Eli Zaretskii <eliz@gnu.org> | 1 | 2006-01-20 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * lread.c (Fload): Don't leak the file descriptor returned by | ||
| 4 | openp if we are going to signal an error. | ||
| 5 | |||
| 3 | * w32.c (sys_close): If FD is outside [0..MAXDESC) limits, pass it | 6 | * w32.c (sys_close): If FD is outside [0..MAXDESC) limits, pass it |
| 4 | directly to _close. | 7 | directly to _close. |
| 5 | (sys_dup): Protect against new_fd larger than fd_info[] can handle. | 8 | (sys_dup): Protect against new_fd larger than fd_info[] can handle. |
diff --git a/src/lread.c b/src/lread.c index 4d9ddfbd009..7be2ad8fa9b 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -801,8 +801,12 @@ Return t if file exists. */) | |||
| 801 | if (!NILP (Fequal (found, XCAR (tem)))) | 801 | if (!NILP (Fequal (found, XCAR (tem)))) |
| 802 | count++; | 802 | count++; |
| 803 | if (count > 3) | 803 | if (count > 3) |
| 804 | Fsignal (Qerror, Fcons (build_string ("Recursive load"), | 804 | { |
| 805 | Fcons (found, Vloads_in_progress))); | 805 | if (fd >= 0) |
| 806 | emacs_close (fd); | ||
| 807 | Fsignal (Qerror, Fcons (build_string ("Recursive load"), | ||
| 808 | Fcons (found, Vloads_in_progress))); | ||
| 809 | } | ||
| 806 | record_unwind_protect (record_load_unwind, Vloads_in_progress); | 810 | record_unwind_protect (record_load_unwind, Vloads_in_progress); |
| 807 | Vloads_in_progress = Fcons (found, Vloads_in_progress); | 811 | Vloads_in_progress = Fcons (found, Vloads_in_progress); |
| 808 | } | 812 | } |