csv_create() opens the output file with fn_open() so csv_destroy() should
close it with fn_close() to ensure that pipes and the standard file
descriptors are closed properly.
{
struct csv_driver *csv = csv_driver_cast (driver);
+ if (csv->file != NULL)
+ fn_close (csv->file_name, csv->file);
+
free (csv->separator);
free (csv->file_name);
- if (csv->file != NULL)
- fclose (csv->file);
free (csv);
}