From 62404ac9ebde8c4ebf6c7b66b8c7799e90ab5e51 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 14 Nov 2020 11:49:12 -0800 Subject: [PATCH] anticipate tight_subtree_search() returning a negative value as error Related to #1801. --- lib/common/ns.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/common/ns.c b/lib/common/ns.c index e47ec6616..0f88c0511 100644 --- a/lib/common/ns.c +++ b/lib/common/ns.c @@ -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; } -- 2.40.0