Commit 887a9853 authored by Geyslan G. Bem's avatar Geyslan G. Bem Committed by Richard Weinberger

um: fix returns without va_end

When using va_list ensure that va_start will be followed by va_end.
Signed-off-by: default avatarGeyslan G. Bem <geyslan@gmail.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 8090bfd2
......@@ -249,21 +249,23 @@ void close_addr(unsigned char *addr, unsigned char *netmask, void *arg)
char *split_if_spec(char *str, ...)
{
char **arg, *end;
char **arg, *end, *ret = NULL;
va_list ap;
va_start(ap, str);
while ((arg = va_arg(ap, char **)) != NULL) {
if (*str == '\0')
return NULL;
goto out;
end = strchr(str, ',');
if (end != str)
*arg = str;
if (end == NULL)
return NULL;
goto out;
*end++ = '\0';
str = end;
}
ret = str;
out:
va_end(ap);
return str;
return ret;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment