mirror of
https://git.proxmox.com/git/mirror_corosync-qdevice
synced 2025-04-28 12:32:27 +00:00
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:
parent
28d49141f8
commit
df3c6722b3
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user