From f36765eb6d0e61c20f829573b1014f26b04add4a Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 14 Nov 2020 12:21:28 -0800 Subject: [PATCH] remove use of longjmp() in update() Like the change to add_tree_edge(), this also fixes some resource leakage that occurred in this error path. Now the tree list in rank2 is correctly cleaned up on error. Related to #1801. --- lib/common/ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/ns.c b/lib/common/ns.c index b2a764066..fcc60c093 100644 --- a/lib/common/ns.c +++ b/lib/common/ns.c @@ -622,7 +622,7 @@ update(edge_t * e, edge_t * f) lca = treeupdate(agtail(f), aghead(f), cutvalue, 1); if (treeupdate(aghead(f), agtail(f), cutvalue, 0) != lca) { agerr(AGERR, "update: mismatched lca in treeupdates\n"); - longjmp (jbuf, 1); + return 2; } ED_cutvalue(f) = -cutvalue; ED_cutvalue(e) = 0; -- 2.40.0