From eb6cdee2e5bd9653a5beaf18880358cbb99466cc Mon Sep 17 00:00:00 2001 From: kevans Date: Tue, 19 Feb 2019 18:32:05 +0000 Subject: [PATCH] MFC r332555: 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(). --- stand/common/commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stand/common/commands.c b/stand/common/commands.c index 1d5000b5563..25eb3ae0095 100644 --- a/stand/common/commands.c +++ b/stand/common/commands.c @@ -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); -- 2.45.0