Subject: [PATCH 26/46] rdma: memory leak RDMAContext::host

From: Nigel Croxon <[email-masked]>
Date: Thu, 14 Nov 2013 22:53:02 +0100

RH-Author: Nigel Croxon <[email-masked]>
Message-id: <[email-masked]>
Patchwork-id: 55704
O-Subject: [RHEL7.0 PATCH 26/42] rdma: memory leak RDMAContext::host
Bugzilla: 1011720
RH-Acked-by: Orit Wasserman <[email-masked]>
RH-Acked-by: Amit Shah <[email-masked]>
RH-Acked-by: Paolo Bonzini <[email-masked]>

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

>From commit ID:
commit e1d0fb378ae3bb4272124a12e3fe1a02c4745eb1
Author: Isaku Yamahata <[email-masked]>
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 <[email-masked]>
    Signed-off-by: Isaku Yamahata <[email-masked]>
    Signed-off-by: Michael R. Hines <[email-masked]>
    Message-id: [email-masked]
    Signed-off-by: Anthony Liguori <[email-masked]>
---
 migration-rdma.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Signed-off-by: Michal Novotny <[email-masked]>
---
 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