Skip to contentSkip to conversation

block/nbd: Fix the regression to free leaked visitor

PATCH Superseded Ashijeet Acharya 2 participants 2 messages Oct 31, 2016 Block layer

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/nbd: Fix the regression to free leaked visitor

This patch frees the leaked visitor in nbd_refresh_filename() and uses visit_free() to fix it.

---
 block/nbd.c | 1 +
 1 file changed, 1 insertion(+)
block/nbd.c +1 -0
index 8ef1438..ff9d01a 100644
@@ -545,6 +545,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
         qdict_put(opts, "tls-creds", qstring_from_str(s->tlscredsid));
     }
 
+    visit_free(ov);
     qdict_flatten(opts);
     bs->full_open_options = opts;
 }
Signature · 1 line
2.6.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Ashijeet Acharya

This patch frees the leaked visitor in nbd_refresh_filename() and uses visit_free() to fix it.

---
 block/nbd.c | 1 +
 1 file changed, 1 insertion(+)

Would be nice to mention that it was commit 491d6c7 that introduced the leak.

Quoted 14 lines
block/nbd.c +1 -0
index 8ef1438..ff9d01a 100644
@@ -545,6 +545,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
         qdict_put(opts, "tls-creds", qstring_from_str(s->tlscredsid));
     }
 
+    visit_free(ov);
     qdict_flatten(opts);
     bs->full_open_options = opts;
 }
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org