diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2021-01-28 20:51:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 20:51:08 +0000 |
commit | 50639d1659093fa6304f78ea10d0cdf204b64568 (patch) | |
tree | b079f094b7b2c8666ebea909a15d830691ebe1a2 /samples/client.c | |
parent | dbfa7f8b3532f0f5ec4203b31901ec26ee6c4f64 (diff) | |
download | libvfio-user-50639d1659093fa6304f78ea10d0cdf204b64568.zip libvfio-user-50639d1659093fa6304f78ea10d0cdf204b64568.tar.gz libvfio-user-50639d1659093fa6304f78ea10d0cdf204b64568.tar.bz2 |
client/server: don't leak memory in client (#285)
Not that useful, apart from running it through Valgrind in CI.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples/client.c')
-rw-r--r-- | samples/client.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/samples/client.c b/samples/client.c index 731f5d6..4296153 100644 --- a/samples/client.c +++ b/samples/client.c @@ -982,6 +982,7 @@ migrate_to(char *old_sock_path, int *server_max_fds, /* connect to the destination server */ sock = init_sock(sock_path); + free(sock_path); negotiate(sock, server_max_fds, pgsize); @@ -1293,6 +1294,11 @@ int main(int argc, char *argv[]) sock = migrate_to(argv[optind], &server_max_fds, &pgsize, nr_iters, migr_iters, path_to_server, migr_reg_index, md5sum, bar1_size); + free(path_to_server); + for (i = 0; i < (int)nr_iters; i++) { + free(migr_iters[i].iov_base); + } + free(migr_iters); /* * Now we must reconfigure the destination server. |