[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] qemu: plug memory leak on migration



Detected by Coverity.  Leak introduced in commit 72de0d2.

* src/qemu/qemu_migration.c (qemuMigrationCookieGraphicsXMLParse):
Clean up on success.
---

Pushing under the trivial rule.

 src/qemu/qemu_migration.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 4516231..f0a0e49 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -460,22 +460,23 @@ qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt)
     if (!(tmp = virXPathString("string(./graphics/@type)", ctxt))) {
         qemuReportError(VIR_ERR_INTERNAL_ERROR,
                         "%s", _("missing type attribute in migration data"));
         goto error;
     }
     if ((grap->type = virDomainGraphicsTypeFromString(tmp)) < 0) {
         qemuReportError(VIR_ERR_INTERNAL_ERROR,
                         _("unknown graphics type %s"), tmp);
         VIR_FREE(tmp);
         goto error;
     }
+    VIR_FREE(tmp);
     if (virXPathInt("string(./graphics/@port)", ctxt, &grap->port) < 0) {
         qemuReportError(VIR_ERR_INTERNAL_ERROR,
                         "%s", _("missing port attribute in migration data"));
         goto error;
     }
     if (grap->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
         if (virXPathInt("string(./graphics/@tlsPort)", ctxt, &grap->tlsPort) < 0) {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
                             "%s", _("missing tlsPort attribute in migration data"));
             goto error;
         }
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]