]> granicus.if.org Git - graphviz/commitdiff
patchwork: fix memory leak by freeing cluster data in graph cleanup
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 18 Jul 2022 07:53:21 +0000 (09:53 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Mon, 25 Jul 2022 18:24:49 +0000 (20:24 +0200)
This fixes a memory leak detected by ASan in the test_clusters test,
which now runs without failures

CHANGELOG.md
lib/patchwork/patchworkinit.c
tests/CMakeLists.txt

index 3bebe7200b8a15f7ceb91b37da9d91e822391bc1..98f76116f3c3b8825752503a251b8ef0e91155b4 100644 (file)
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Memory leak in osage
 - Segmentation fault when running test example neatopack.c #1800
 - Memory leak in dot when using clusters
+- Memory leak in patchwork when using clusters
 
 ## [5.0.0] – 2022-07-07
 
index 481fb15679a4f4dd2cb43c7175f6b037d2aac196..7b5ebe2c89a9310b162bd92402e7a38c830a8f4a 100644 (file)
@@ -152,6 +152,7 @@ void patchwork_layout(Agraph_t *g)
 static void patchwork_cleanup_graph(graph_t * g)
 {
     free(GD_neato_nlist(g));
+    free(GD_clust(g));
 }
 
 void patchwork_cleanup(graph_t * g)
index 01ffee338ddc88e0bceef6b3de00b9c840ed7bc1..5d0fcf21417f545456a7388837acb78d74f480fb 100644 (file)
@@ -68,7 +68,6 @@ endmacro()
 
 CREATE_TEST(AGraph_construction)
 CREATE_TEST(clusters)
-set_tests_properties(test_clusters PROPERTIES WILL_FAIL true)
 CREATE_TEST(engines)
 CREATE_TEST(GVContext_construction)
 CREATE_TEST(GVContext_render_svg)