Skip to content

Commit

Permalink
Fix flushing of output stream in CSV writer
Browse files Browse the repository at this point in the history
  • Loading branch information
iamazeem committed Nov 25, 2024
1 parent f957090 commit bf144bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/utils/writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ enum zsv_writer_status zsv_writer_delete(zsv_csv_writer w) {
if (w->started)
w->out.write("\n", 1, 1, w->out.stream);

if (w->out.stream && w->out.stream != stdout) {
fclose(w->out.stream);
w->out.stream = NULL;
}

if (w->out.buff)
free(w->out.buff);
free(w);
Expand Down

0 comments on commit bf144bd

Please sign in to comment.