Browse Source

fix a memory leak

Reported in bug report 504 by Ferdy
pre-master-46
Holger Vogt 6 years ago
parent
commit
23ceaabf83
  1. 4
      src/frontend/dotcards.c

4
src/frontend/dotcards.c

@ -273,7 +273,8 @@ ft_cktcoms(bool terse)
/* Now all the '.' lines */ /* Now all the '.' lines */
while (coms) { while (coms) {
command = cp_lexer(coms->wl_word);
wordlist* freecom;
freecom = command = cp_lexer(coms->wl_word);
if (!command || command->wl_word == (char *) NULL) { if (!command || command->wl_word == (char *) NULL) {
/* Line not converted to a wordlist */ /* Line not converted to a wordlist */
goto bad; goto bad;
@ -369,6 +370,7 @@ ft_cktcoms(bool terse)
goto bad; goto bad;
} }
coms = coms->wl_next; /* go to next line */ coms = coms->wl_next; /* go to next line */
wl_free(freecom);
} /* end of loop over '.' lines */ } /* end of loop over '.' lines */
nocmds: nocmds:

Loading…
Cancel
Save