loader: provide values in help_getnext()

With r328289 we attempt to make sure we free the resources allocated in
help_getnext(), however, it is possible that we get no resources allocated
and help_getnext() will return early.

Make sure we have pointers set to NULL early in help_getnext().

Reported by:	Andy Fiddaman
This commit is contained in:
Toomas Soome 2018-04-16 07:26:23 +00:00
parent 3877c32ec9
commit 5276f60430
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=332555

View File

@ -64,7 +64,9 @@ static int
help_getnext(int fd, char **topic, char **subtopic, char **desc)
{
char line[81], *cp, *ep;
/* Make sure we provide sane values. */
*topic = *subtopic = *desc = NULL;
for (;;) {
if (fgetstr(line, 80, fd) < 0)
return(0);