From 45b00c44ceffeac8143fb8857a12677234114f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 24 Jun 2015 13:33:32 +0200 Subject: contrib: remove unnecessary strdup() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Vladimir Sementsov-Ogievskiy --- contrib/ivshmem-server/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'contrib/ivshmem-server') 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 */ -- cgit v1.2.3