diff options
author | Marc-André Lureau | 2015-06-24 13:33:32 +0200 |
---|---|---|
committer | Marc-André Lureau | 2015-10-24 18:03:18 +0200 |
commit | 45b00c44ceffeac8143fb8857a12677234114f2b (patch) | |
tree | f0d7407e7896c4317db5b50e1584b03009ac6b0c /contrib/ivshmem-server/main.c | |
parent | ivshmem: add check on protocol version in QEMU (diff) | |
download | qemu-45b00c44ceffeac8143fb8857a12677234114f2b.tar.gz qemu-45b00c44ceffeac8143fb8857a12677234114f2b.tar.xz qemu-45b00c44ceffeac8143fb8857a12677234114f2b.zip |
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>
Diffstat (limited to 'contrib/ivshmem-server/main.c')
-rw-r--r-- | contrib/ivshmem-server/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c index b960048729..54ff001c23 100644 --- a/contrib/ivshmem-server/main.c +++ b/contrib/ivshmem-server/main.c @@ -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 */ |