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/lmorph.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'hacks/lmorph.c') diff --git a/hacks/lmorph.c b/hacks/lmorph.c index 9468a72..ae45da1 100644 --- a/hacks/lmorph.c +++ b/hacks/lmorph.c @@ -362,6 +362,7 @@ initLMorph(struct state *st) fprintf(stderr, "figtype should be `all', `open' or `closed'.\n"); st->figType = FT_ALL; } + if (ft) free (ft); if (steps <= 0) steps = (random() % 400) + 100; @@ -389,7 +390,7 @@ initLMorph(struct state *st) st->aSlopeTo = (XPoint *) xmalloc(st->numPoints * sizeof(XPoint)); st->aSlopeFrom = (XPoint *) xmalloc(st->numPoints * sizeof(XPoint)); - st->aNext = (XPoint *) xmalloc(st->numPoints * sizeof(XPoint)); + st->aNext = 0; for (i = 0; i < st->numPoints ; i++) { st->aSlopeTo[i].x = 0.0; @@ -562,6 +563,16 @@ static void lmorph_free (Display *dpy, Window window, void *closure) { struct state *st = (struct state *) closure; + int i; + XFreeGC (dpy, st->gcDraw); + XFreeGC (dpy, st->gcClear); + free (st->aWork[0]); + free (st->aWork[1]); + free (st->aTmp); + free (st->aSlopeTo); + free (st->aSlopeFrom); + for (i = 0; i < MAXFIGS; i++) + if (st->a[i]) free (st->a[i]); free (st); } -- cgit v1.2.3-55-g7522