yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From ca20b922adfc76c1aff60e86ae731295cf82f884 Mon Sep 17 00:00:00 2001
Message-Id: <ca20b922adfc76c1aff60e86ae731295cf82f884.1387382496.git.minovotn@redhat.com>
In-Reply-To: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
References: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
From: Nigel Croxon <ncroxon@redhat.com>
Date: Thu, 14 Nov 2013 22:53:02 +0100
Subject: [PATCH 26/46] rdma: memory leak RDMAContext::host

RH-Author: Nigel Croxon <ncroxon@redhat.com>
Message-id: <1384469598-13137-27-git-send-email-ncroxon@redhat.com>
Patchwork-id: 55704
O-Subject: [RHEL7.0 PATCH 26/42] rdma: memory leak RDMAContext::host
Bugzilla: 1011720
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
RH-Acked-by: Amit Shah <amit.shah@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Bugzilla: 1011720
https://bugzilla.redhat.com/show_bug.cgi?id=1011720

>From commit ID:
commit e1d0fb378ae3bb4272124a12e3fe1a02c4745eb1
Author: Isaku Yamahata <yamahata@private.email.ne.jp>
Date:   Sat Aug 3 22:54:54 2013 -0400

    rdma: memory leak RDMAContext::host

    It is allocated by g_strdup(), so needs to be freed.

    Reviewed-by: Michael R. Hines <mrhines@us.ibm.com>
    Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp>
    Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
    Message-id: 1375584894-9917-8-git-send-email-mrhines@linux.vnet.ibm.com
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 migration-rdma.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 migration-rdma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/migration-rdma.c b/migration-rdma.c
index 6afe98c..ff0a823 100644
--- a/migration-rdma.c
+++ b/migration-rdma.c
@@ -2097,6 +2097,8 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
         rdma_destroy_event_channel(rdma->channel);
         rdma->channel = NULL;
     }
+    g_free(rdma->host);
+    rdma->host = NULL;
 }
 
 
-- 
1.7.11.7