]> granicus.if.org Git - graphviz/commitdiff
Fix crash in "dot -Tsvgz -O KW91.dot" cause by attempt to fclose(NULL)
authorellson <devnull@localhost>
Tue, 24 Jul 2007 20:04:53 +0000 (20:04 +0000)
committerellson <devnull@localhost>
Tue, 24 Jul 2007 20:04:53 +0000 (20:04 +0000)
lib/gvc/gvdevice.c

index 84d6c863a9aaff9cdaeab935fd91e1d260bd278e..b693390e38c9eb261e2c60ccb094918620838049 100644 (file)
@@ -112,8 +112,10 @@ void gvdevice_finalize(GVJ_t * firstjob)
        if (job->output_filename
          && job->output_file != stdout 
          && ! job->external_surface) {
-           fclose(job->output_file);
-           job->output_file = NULL;
+           if (job->output_file) {
+               fclose(job->output_file);
+               job->output_file = NULL;
+           }
             job->output_filename = NULL;
        }
     }