diff options
author | Simon Rettberg | 2019-02-18 11:55:41 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-02-18 11:55:41 +0100 |
commit | ae69a754244c4e475c8d2591772ca8e005071d83 (patch) | |
tree | 58b3fa7abc2dcfe3c23e1c0ce108950c720826ab /hacks/lmorph.c | |
parent | Update gitignore (diff) | |
download | xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.gz xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.xz xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.zip |
Update to 5.42
Diffstat (limited to 'hacks/lmorph.c')
-rw-r--r-- | hacks/lmorph.c | 13 |
1 files changed, 12 insertions, 1 deletions
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); } |