Fix memory leak found by valgrind/paranoia.

This commit is contained in:
Giles Atkinson 2022-05-10 08:25:28 +01:00 committed by Holger Vogt
parent 2e329986b8
commit 7511bef7d4
1 changed files with 1 additions and 0 deletions

View File

@ -43,6 +43,7 @@ struct pnode *ft_getpnames_from_string(const char *sz, bool check)
* structure must also be freed if the check fails since it is not
* being returned. */
if (check && !checkvalid(pn)) {
dvec_free(pn->pn_value);
free_pnode(pn);
return (struct pnode *) NULL;
}