Fix fd leak when lecture file option is enabled. From Jerry Brown
This commit is contained in:
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\
|
||||
|
Reference in New Issue
Block a user