diff options
author | Kevin Wolf <kwolf@redhat.com> | 2012-07-02 15:13:53 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-07-17 16:48:32 +0200 |
commit | 9e559533bd825a3e371497875576137a8586c831 (patch) | |
tree | a217611605e192f8f8ce980dd7766d37e355f628 | |
parent | b7eb0c9f95e50239ce5b5266373dc52c85e75299 (diff) | |
download | qemu-9e559533bd825a3e371497875576137a8586c831.zip qemu-9e559533bd825a3e371497875576137a8586c831.tar.gz qemu-9e559533bd825a3e371497875576137a8586c831.tar.bz2 |
qemu-io: Fix memory leaks
Almost all callers of create_iovec() forgot to destroy the qiov when the
request has completed.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-rw-r--r-- | qemu-io.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -670,6 +670,7 @@ static int readv_f(int argc, char **argv) print_report("read", &t2, offset, qiov.size, total, cnt, Cflag); out: + qemu_iovec_destroy(&qiov); qemu_io_free(buf); return 0; } @@ -928,6 +929,7 @@ static int writev_f(int argc, char **argv) t2 = tsub(t2, t1); print_report("wrote", &t2, offset, qiov.size, total, cnt, Cflag); out: + qemu_iovec_destroy(&qiov); qemu_io_free(buf); return 0; } @@ -1126,6 +1128,7 @@ static void aio_write_done(void *opaque, int ret) ctx->qiov.size, 1, ctx->Cflag); out: qemu_io_free(ctx->buf); + qemu_iovec_destroy(&ctx->qiov); g_free(ctx); } @@ -1166,6 +1169,7 @@ static void aio_read_done(void *opaque, int ret) ctx->qiov.size, 1, ctx->Cflag); out: qemu_io_free(ctx->buf); + qemu_iovec_destroy(&ctx->qiov); g_free(ctx); } |