diff options
-rw-r--r-- | samples/client.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/samples/client.c b/samples/client.c index 27382b8..04737a9 100644 --- a/samples/client.c +++ b/samples/client.c @@ -511,6 +511,7 @@ set_migration_state(int sock, uint32_t state) pthread_mutex_unlock(&mutex); if (ret < 0) { + free(response); return ret; } @@ -523,6 +524,8 @@ set_migration_state(int sock, uint32_t state) err(EXIT_FAILURE, "invalid response to set_migration_state (payload)"); } + free(response); + return ret; } @@ -765,7 +768,7 @@ get_dirty_bitmap(int sock, struct vfio_user_dma_map *dma_region) char *bitmap; int ret; - ssize_t size = sizeof(*res) + sizeof(*report) + bitmap_size; + size_t size = sizeof(*res) + sizeof(*report) + bitmap_size; void* data = calloc(1, size); assert(data != NULL); @@ -1365,6 +1368,7 @@ int main(int argc, char *argv[]) free(dma_regions); free(dma_region_fds); + free(dirty_pages); return 0; } |