From: John Darrington Date: Thu, 30 Sep 2010 08:51:49 +0000 (+0200) Subject: Fix memory leak in output rendering X-Git-Tag: v0.7.6~132 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8cbc356e15010f4ca86b4f43652bbc12b57b8fc;p=pspp-builds.git Fix memory leak in output rendering --- diff --git a/src/output/render.c b/src/output/render.c index 25dd28b5..8c02833c 100644 --- a/src/output/render.c +++ b/src/output/render.c @@ -778,6 +778,7 @@ render_page_unref (struct render_page *page) { if (page != NULL && --page->ref_cnt == 0) { + int i; struct render_overflow *overflow, *next; HMAP_FOR_EACH_SAFE (overflow, next, struct render_overflow, node, @@ -786,8 +787,13 @@ render_page_unref (struct render_page *page) hmap_destroy (&page->overflows); table_unref (page->table); - free (page->cp[H]); - free (page->cp[V]); + + for (i = 0; i < TABLE_N_AXES; ++i) + { + free (page->join_crossing[i]); + free (page->cp[i]); + } + free (page); } } @@ -1393,4 +1399,3 @@ insert_overflow (struct render_page_selection *s, return of; } -