diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-04-10 09:18:41 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-04-10 09:19:59 -0700 |
commit | c2ffd57727e5f02b94f1c46392a740e404d4c270 (patch) | |
tree | e294697db24e2f88eb5b043aa14d350d72978192 /main.c | |
parent | 093d33fb6bc108030539b38c4bfa202b148d3c7a (diff) |
Close fd for reading old Makefile when done, instead of leaking it
Found by Oracle Parfait:
Error: File Leak
File Leak [file-ptr-leak]:
Leaked File fdin
at line 799 of main.c in function 'redirect'.
fdin initialized at line 769 with fopen
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -790,6 +790,7 @@ redirect(const char *line, const char *makefile) fputs(buf, fdout); } } + fclose(fdin); fflush(fdout); #ifndef HAVE_FCHMOD chmod(makefile, st.st_mode); |