mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 05:48:18 +00:00
Fix fd leak when lecture file option is enabled. From Jerry Brown
This commit is contained in:
parent
3c6d0cc871
commit
50004e00b8
1
check.c
1
check.c
@ -126,6 +126,7 @@ lecture(status)
|
||||
if (def_lecture_file && (fp = fopen(def_lecture_file, "r")) != NULL) {
|
||||
while ((nread = fread(buf, sizeof(char), sizeof(buf), fp)) != 0)
|
||||
fwrite(buf, nread, 1, stderr);
|
||||
fclose(fp);
|
||||
} else {
|
||||
(void) fputs("\n\
|
||||
We trust you have received the usual lecture from the local System\n\
|
||||
|
Loading…
x
Reference in New Issue
Block a user