]> granicus.if.org Git - graphviz/commitdiff
anticipate tight_subtree_search() returning a negative value as error
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 14 Nov 2020 19:49:12 +0000 (11:49 -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 e47ec66162f4ccde1372a67ffa5b78f6bf7faecf..0f88c051130dc5ff8aada2160328a83006e38d7d 100644 (file)
@@ -298,6 +298,10 @@ static subtree_t *find_tight_subtree(Agnode_t *v)
     rv = NEW(subtree_t);
     rv->rep = v;
     rv->size = tight_subtree_search(v,rv);
+    if (rv->size < 0) {
+        free(rv);
+        return NULL;
+    }
     rv->par = rv;
     return rv;
 }