Browse Source

Remove memory leak: If the check of the data fails, the data itself is leaked.

Signed-off-by: Holger Vogt <holger.vogt@uni-due.de>
pre-master-46
Jim Monte 7 years ago
committed by Holger Vogt
parent
commit
6bce493d25
  1. 12
      src/frontend/parse.c

12
src/frontend/parse.c

@ -50,11 +50,17 @@ ft_getpnames(wordlist *wl, bool check)
if (rv)
return (NULL);
if (check && !checkvalid(pn))
return (NULL);
/* If validation is requested, do it and return NULL on failure. The
* structure must also be freed if the check fails since it is not
* being returned. */
if (check && !checkvalid(pn)) {
free_pnode(pn);
return (struct pnode *) NULL;
}
return (pn);
}
} /* end of function ft_getpnames */
/* See if there are any variables around which have length 0 and are

Loading…
Cancel
Save