diff mbox

[6/6] NBD: Avoid leaking a couple of strings when the NBD device is closed

Message ID 1304420906-5776-7-git-send-email-kwolf@redhat.com
State New
Headers show

Commit Message

Kevin Wolf May 3, 2011, 11:08 a.m. UTC
From: Nick Thomas <nick@bytemark.co.uk>

Signed-off-by: Nick Thomas <nick@bytemark.co.uk>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/nbd.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/block/nbd.c b/block/nbd.c
index 1d6b225..7a52f62 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -239,6 +239,10 @@  static int nbd_write(BlockDriverState *bs, int64_t sector_num,
 
 static void nbd_close(BlockDriverState *bs)
 {
+    BDRVNBDState *s = bs->opaque;
+    qemu_free(s->export_name);
+    qemu_free(s->host_spec);
+
     nbd_teardown_connection(bs);
 }