From 08b2353ffcacb11dab19da58825789e2c79bbfbf Mon Sep 17 00:00:00 2001 From: north Date: Thu, 16 Apr 2009 18:13:58 +0000 Subject: [PATCH] Fix error in freeing edge when deleted. --- lib/cgraph/edge.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cgraph/edge.c b/lib/cgraph/edge.c index fe1b18990..59120f115 100644 --- a/lib/cgraph/edge.c +++ b/lib/cgraph/edge.c @@ -356,7 +356,8 @@ int agdeledge(Agraph_t * g, Agedge_t * e) agfreeid(g, AGEDGE, AGID(e)); } if (agapply (g, (Agobj_t *) e, (agobjfn_t) agdeledgeimage, NILedge, FALSE) == SUCCESS) { - agfree(g, e); + if (g == agroot(g)) + agfree(g, e); return SUCCESS; } else return FAILURE; -- 2.40.0