qnetd: Don't alloc host_addr

getopt will return pointer to argv so there is no need to dup optarg.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
Jan Friesse 2020-11-23 14:14:05 +01:00
parent 28d49141f8
commit df3c6722b3

View File

@ -289,11 +289,7 @@ cli_parse(int argc, char * const argv[], char **host_addr, uint16_t *host_port,
}
break;
case 'l':
free(*host_addr);
*host_addr = strdup(optarg);
if (*host_addr == NULL) {
errx(EXIT_FAILURE, "Can't alloc memory for host addr string");
}
*host_addr = optarg;
break;
case 'm':
if (utils_strtonum(optarg, 0, LLONG_MAX, &tmpll) == -1) {