]> granicus.if.org Git - graphviz/commitdiff
osage_cleanup: add missing cleanup of edges
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 17 Jul 2022 11:13:14 +0000 (13:13 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 25 Jul 2022 18:24:47 +0000 (20:24 +0200)
This fixes a memory leak detected by ASan in the test_engines test,
which now runs without failures

CHANGELOG.md
lib/osage/osageinit.c
tests/CMakeLists.txt

index 40b3f344feb8ba8a78f7b5233d68b52db2513c02..73632a20d1c3f9f31f50602cb5a22917f0828a35 100644 (file)
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - missing Perl includes patch #2262
 - smyrna: incorrect tokenization in frmobjectui.c:set_attr_object_type #2259
 - [Dot] Record shape+UTF+" | "=Eats spaces. #925
+- Memory leak in osage
 
 ## [5.0.0] – 2022-07-07
 
index 2349a7df7cda0aaf175ba5bd15a10b467eafe893..3d0028b7cc7cf3d9418345a84251240ff18e4724 100644 (file)
@@ -388,6 +388,9 @@ void osage_cleanup(Agraph_t *g)
     node_t *n;
 
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
+        for (edge_t *e = agfstout(g, n); e; e = agnxtout(g, e)) {
+            gv_cleanup_edge(e);
+        }
         gv_cleanup_node(n);
     }
     cleanup_graphs(g);
index 242d1c322b67b7f604a6d37493891eea05e8eefd..fb3492885ad224dac7d4d90a1df3a0fa9622a8fc 100644 (file)
@@ -68,7 +68,6 @@ endmacro()
 
 CREATE_TEST(AGraph_construction)
 CREATE_TEST(engines)
-set_tests_properties(test_engines PROPERTIES WILL_FAIL true)
 CREATE_TEST(GVContext_construction)
 CREATE_TEST(GVContext_render_svg)
 CREATE_TEST(GVLayout_construction)