]> granicus.if.org Git - graphviz/commitdiff
smyrna: remove guard around call to 'free'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 8 Apr 2022 02:01:39 +0000 (19:01 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 10 Apr 2022 20:48:40 +0000 (13:48 -0700)
Calling `free(NULL)` is a well-defined no-op.

cmd/smyrna/viewport.c

index 7a1d87782762aef4dcfb84812982444609b493d3..cfdf798825e31f4f75b3de37bde533a8728089c4 100644 (file)
@@ -245,10 +245,7 @@ static gboolean gl_main_expose(gpointer data)
 
 static void get_data_dir(void)
 {
-    if (view->template_file) {
-       free(view->template_file);
-    }
-
+    free(view->template_file);
     view->template_file = strdup(smyrnaPath("template.dot"));
 }