From 26ace1c4f3bbfad2dcf22225d9bf4e11b3bd0849 Mon Sep 17 00:00:00 2001 From: John Ellson Date: Wed, 4 Sep 2013 22:05:58 -0400 Subject: [PATCH] possible fix for memory corruption - Redhat BZ#847458 --- lib/gvc/gvevent.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/gvc/gvevent.c b/lib/gvc/gvevent.c index 97305e2b4..b9e398135 100644 --- a/lib/gvc/gvevent.c +++ b/lib/gvc/gvevent.c @@ -681,11 +681,13 @@ static void gvevent_read (GVJ_t * job, const char *filename, const char *layout) g = agread(f); #else /* WITH_CGRAPH */ g = agread(f,NIL(Agdisc_t *)); + #endif /* WITH_CGRAPH */ fclose(f); } if (!g) return; /* FIXME - need some error handling */ + if (gvc->g) { gvle = gvc->layout.engine; if (gvle && gvle->cleanup) @@ -693,6 +695,12 @@ static void gvevent_read (GVJ_t * job, const char *filename, const char *layout) graph_cleanup(gvc->g); agclose(gvc->g); } + +#ifdef WITH_CGRAPH + aginit (g, AGRAPH, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + aginit (g, AGNODE, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); + aginit (g, AGEDGE, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); +#endif gvc->g = g; GD_gvc(g) = gvc; gvLayout(gvc, g, layout); -- 2.40.0