From bdaa9b42526cea72b30b400c1f40891a9204126d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 20 Feb 2011 14:39:09 -0500 Subject: fclose() output_file if render fails. --- dimension/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dimension') diff --git a/dimension/main.c b/dimension/main.c index 5274bdf..f8b86b4 100644 --- a/dimension/main.c +++ b/dimension/main.c @@ -307,6 +307,7 @@ main(int argc, char **argv) scene->nthreads); if (dmnsn_finish_progress(render_progress) != 0) { + fclose(output_file); dmnsn_delete_timer(parse_timer); dmnsn_delete_scene(scene); fprintf(stderr, "Error rendering scene!\n"); @@ -318,8 +319,8 @@ main(int argc, char **argv) dmnsn_progress *output_progress = dmnsn_png_write_canvas_async(scene->canvas, output_file); if (!output_progress) { - dmnsn_delete_timer(parse_timer); fclose(output_file); + dmnsn_delete_timer(parse_timer); dmnsn_delete_scene(scene); fprintf(stderr, "Couldn't initialize PNG export!\n"); return EXIT_FAILURE; -- cgit v1.2.3