]> git.proxmox.com Git - mirror_corosync-qdevice.git/commitdiff
qnetd: Don't alloc host_addr master
authorJan Friesse <jfriesse@redhat.com>
Mon, 23 Nov 2020 13:14:05 +0000 (14:14 +0100)
committerJan Friesse <jfriesse@redhat.com>
Mon, 23 Nov 2020 13:18:41 +0000 (14:18 +0100)
getopt will return pointer to argv so there is no need to dup optarg.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
qdevices/corosync-qnetd.c

index 0d7f764af7b518bd98d04af84fe1362800a0059d..5a5ab4c132398643d60b17e2fd958c89627e283c 100644 (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) {