aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Henderson <william.henderson@nutanix.com>2023-08-02 14:20:14 +0000
committerJohn Levon <john.levon@nutanix.com>2023-09-15 13:05:01 +0100
commit71edb7b4dece0279331430998c0f5d09a3de2934 (patch)
tree04545b983b0ae98205f13baa2c5b78ec67704bce
parenta04e4bbdef477514c5309e396e3c4cf8102cb0a0 (diff)
downloadlibvfio-user-71edb7b4dece0279331430998c0f5d09a3de2934.zip
libvfio-user-71edb7b4dece0279331430998c0f5d09a3de2934.tar.gz
libvfio-user-71edb7b4dece0279331430998c0f5d09a3de2934.tar.bz2
fix: obvious use-after-free
Signed-off-by: William Henderson <william.henderson@nutanix.com>
-rw-r--r--samples/client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/client.c b/samples/client.c
index 91ae073..031201e 100644
--- a/samples/client.c
+++ b/samples/client.c
@@ -559,9 +559,11 @@ read_migr_data(int sock, void *buf, size_t len)
memcpy(buf, res->data, res->size);
+ uint32_t size = res->size;
+
free(res);
- return res->size;
+ return size;
}
static int