]> granicus.if.org Git - graphviz/commitdiff
anticipate merge_trees() returning NULL to indicate failure
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 14 Nov 2020 19:54:40 +0000 (11:54 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 23 Jan 2021 04:39:06 +0000 (20:39 -0800)
Related to #1801.

lib/common/ns.c

index 0f88c051130dc5ff8aada2160328a83006e38d7d..ec3f3031a47c204a8acb2d7ae24f586d01900653 100644 (file)
@@ -527,6 +527,10 @@ int feasible_tree(void)
       break;
     }
     tree1 = merge_trees(ee);
+    if (tree1 == NULL) {
+      error = 2;
+      break;
+    }
     STheapify(heap,tree1->heap_index);
   }