From f4956a1f9dc66973c1a9c9196ef893412b2545d7 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 8 May 2015 18:57:18 +0100 Subject: [PATCH] Fix two small memory leaks in config mechanism. The memory dangling off ssd->sesslist should be freed when ssd itself goes away, and the font settings ctrlset we delete in gtkcfg.c should be freed as well once it's been removed from its containing array. Thanks to Ranjini Aravind for pointing these out. --- config.c | 1 + unix/gtkcfg.c | 1 + 2 files changed, 2 insertions(+) diff --git a/config.c b/config.c index d2f2891b..a134e326 100644 --- a/config.c +++ b/config.c @@ -569,6 +569,7 @@ struct sessionsaver_data { static void sessionsaver_data_free(void *ssdv) { struct sessionsaver_data *ssd = (struct sessionsaver_data *)ssdv; + get_sesslist(&ssd->sesslist, FALSE); sfree(ssd->savedsession); sfree(ssd); } diff --git a/unix/gtkcfg.c b/unix/gtkcfg.c index ab8ef973..958a3f66 100644 --- a/unix/gtkcfg.c +++ b/unix/gtkcfg.c @@ -81,6 +81,7 @@ void gtk_setup_config_box(struct controlbox *b, int midsession, void *win) memmove(b->ctrlsets+i, b->ctrlsets+i+1, (b->nctrlsets-i-1) * sizeof(*b->ctrlsets)); b->nctrlsets--; + ctrl_free_set(s2); break; } } -- 2.45.2