From 23ceaabf837883c356aadafd017c0fabd5dbe565 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 3 Aug 2020 22:41:32 +0200 Subject: [PATCH] fix a memory leak Reported in bug report 504 by Ferdy --- src/frontend/dotcards.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/dotcards.c b/src/frontend/dotcards.c index 48cf5a26a..f855228e6 100644 --- a/src/frontend/dotcards.c +++ b/src/frontend/dotcards.c @@ -273,7 +273,8 @@ ft_cktcoms(bool terse) /* Now all the '.' lines */ while (coms) { - command = cp_lexer(coms->wl_word); + wordlist* freecom; + freecom = command = cp_lexer(coms->wl_word); if (!command || command->wl_word == (char *) NULL) { /* Line not converted to a wordlist */ goto bad; @@ -369,6 +370,7 @@ ft_cktcoms(bool terse) goto bad; } coms = coms->wl_next; /* go to next line */ + wl_free(freecom); } /* end of loop over '.' lines */ nocmds: