diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-11-17 19:15:18 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-11-17 19:15:18 +0100 |
commit | fa2b2c211025953f162c4d7935ed86db0db560d7 (patch) | |
tree | e35ee6a80349ca7b3042bad5a34a155d65a5a84d /src | |
parent | b86f22bbd30e5a29c90bb5744e97802ae02b4745 (diff) |
add_stdin_to_filelist: fix resource leak upon fwrite failure
Closes #730
Diffstat (limited to 'src')
-rw-r--r-- | src/filelist.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/filelist.c b/src/filelist.c index 223956d..f1e820c 100644 --- a/src/filelist.c +++ b/src/filelist.c @@ -180,6 +180,7 @@ static void add_stdin_to_filelist(void) while ((readsize = fread(buf, sizeof(char), sizeof(buf), stdin)) > 0) { if (fwrite(buf, sizeof(char), readsize, outfile) < readsize) { free(sfn); + fclose(outfile); return; } } |