mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 19:33:39 +08:00
contrib: remove unnecessary strdup()
getopt() optarg points to argv memory, no need to dup those values, fixes small leaks detected by clang-analyzer. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
This commit is contained in:
parent
5105b1d8c2
commit
45b00c44ce
@ -53,7 +53,7 @@ ivshmem_client_parse_args(IvshmemClientArgs *args, int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'S': /* unix_sock_path */
|
||||
args->unix_sock_path = strdup(optarg);
|
||||
args->unix_sock_path = optarg;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -92,15 +92,15 @@ ivshmem_server_parse_args(IvshmemServerArgs *args, int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case 'p': /* pid_file */
|
||||
args->pid_file = strdup(optarg);
|
||||
args->pid_file = optarg;
|
||||
break;
|
||||
|
||||
case 'S': /* unix_socket_path */
|
||||
args->unix_socket_path = strdup(optarg);
|
||||
args->unix_socket_path = optarg;
|
||||
break;
|
||||
|
||||
case 'm': /* shm_path */
|
||||
args->shm_path = strdup(optarg);
|
||||
args->shm_path = optarg;
|
||||
break;
|
||||
|
||||
case 'l': /* shm_size */
|
||||
|
Loading…
Reference in New Issue
Block a user