[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/27] rdma: fix memory leak
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 01/27] rdma: fix memory leak |
Date: |
Thu, 2 Jul 2015 18:09:49 +0200 |
From: Gonglei <address@hidden>
Variable "r" going out of scope leaks the storage
it points to in line 3268.
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Amit Shah <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/rdma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index b777273..0a00290 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3263,12 +3263,13 @@ static const QEMUFileOps rdma_write_ops = {
static void *qemu_fopen_rdma(RDMAContext *rdma, const char *mode)
{
- QEMUFileRDMA *r = g_malloc0(sizeof(QEMUFileRDMA));
+ QEMUFileRDMA *r;
if (qemu_file_mode_is_not_valid(mode)) {
return NULL;
}
+ r = g_malloc0(sizeof(QEMUFileRDMA));
r->rdma = rdma;
if (mode[0] == 'w') {
--
2.4.3
- [Qemu-devel] [PULL v2 00/27] Migration pull request, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 01/27] rdma: fix memory leak,
Juan Quintela <=
- [Qemu-devel] [PULL 02/27] Only try and read a VMDescription if it should be there, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 03/27] rdma typos, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 04/27] Store block name in local blocks structure, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 07/27] Allow rdma_delete_block to work without the hash, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 06/27] Rework ram_control_load_hook to hook during block load, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 08/27] Rework ram block hash, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 05/27] Translate offsets to destination address space, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 10/27] Sanity check RDMA remote data, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 09/27] Sort destination RAMBlocks to be the same as the source, Juan Quintela, 2015/07/02
- [Qemu-devel] [PULL 11/27] Fail more cleanly in mismatched RAM cases, Juan Quintela, 2015/07/02