]>
git.proxmox.com Git - mirror_corosync-qdevice.git/commitdiff
projects
/
mirror_corosync-qdevice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28d4914
)
qnetd: Don't alloc host_addr
master
author
Jan Friesse
<jfriesse@redhat.com>
Mon, 23 Nov 2020 13:14:05 +0000
(14:14 +0100)
committer
Jan 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
patch
|
blob
|
blame
|
history
diff --git
a/qdevices/corosync-qnetd.c
b/qdevices/corosync-qnetd.c
index 0d7f764af7b518bd98d04af84fe1362800a0059d..5a5ab4c132398643d60b17e2fd958c89627e283c 100644
(file)
--- a/
qdevices/corosync-qnetd.c
+++ b/
qdevices/corosync-qnetd.c
@@
-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) {