diff options
author | Li Zhijian <lizhijian@cn.fujitsu.com> | 2021-05-25 16:05:50 +0800 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2021-05-26 18:39:32 +0100 |
commit | f53b450ada3bf7fa1c88fbf4f13b864af7795bd3 (patch) | |
tree | ed952aa3a29b087da92850b9662602ba73336e06 | |
parent | 4e812d2338acb354b969b59f792f413f567c0ace (diff) | |
download | qemu-f53b450ada3bf7fa1c88fbf4f13b864af7795bd3.zip qemu-f53b450ada3bf7fa1c88fbf4f13b864af7795bd3.tar.gz qemu-f53b450ada3bf7fa1c88fbf4f13b864af7795bd3.tar.bz2 |
migration/rdma: Fix rdma_addrinfo res leaks
rdma_freeaddrinfo() is the reverse operation of rdma_getaddrinfo()
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20210525080552.28259-2-lizhijian@cn.fujitsu.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
-rw-r--r-- | migration/rdma.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/migration/rdma.c b/migration/rdma.c index 7e7595f..651534e 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -987,10 +987,12 @@ static int qemu_rdma_resolve_host(RDMAContext *rdma, Error **errp) } } + rdma_freeaddrinfo(res); ERROR(errp, "could not resolve address %s", rdma->host); goto err_resolve_get_addr; route: + rdma_freeaddrinfo(res); qemu_rdma_dump_gid("source_resolve_addr", rdma->cm_id); ret = rdma_get_cm_event(rdma->channel, &cm_event); @@ -2593,6 +2595,7 @@ static int qemu_rdma_dest_init(RDMAContext *rdma, Error **errp) break; } + rdma_freeaddrinfo(res); if (!e) { ERROR(errp, "Error: could not rdma_bind_addr!"); goto err_dest_init_bind_addr; |