From ae69a754244c4e475c8d2591772ca8e005071d83 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Feb 2019 11:55:41 +0100 Subject: Update to 5.42 --- hacks/imsmap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'hacks/imsmap.c') diff --git a/hacks/imsmap.c b/hacks/imsmap.c index 1877243..475447b 100644 --- a/hacks/imsmap.c +++ b/hacks/imsmap.c @@ -161,8 +161,10 @@ init_map (struct state *st) if (mono_p) st->flip_xy = 0; - else if (st->colors) + else if (st->colors) { free_colors (st->xgwa.screen, st->cmap, st->colors, st->ncolors); + free (st->colors); + } st->colors = 0; st->ncolors = get_integer_resource (st->dpy, "ncolors", "Integer"); @@ -187,6 +189,7 @@ init_map (struct state *st) if (!mono_p) { if (st->ncolors < 1) st->ncolors = 1; + if (st->colors) free (st->colors); st->colors = (XColor *) malloc (st->ncolors * sizeof(*st->colors)); make_smooth_colormap (st->xgwa.screen, st->xgwa.visual, st->cmap, @@ -387,6 +390,8 @@ static void imsmap_free (Display *dpy, Window window, void *closure) { struct state *st = (struct state *) closure; + XFreeGC (dpy, st->gc); + XFreeGC (dpy, st->gc2); if (st->colors) free (st->colors); if (st->cell) free (st->cell); free (st); -- cgit v1.2.3-55-g7522