[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/6] block/vdi: When writing new bmap entry fails, don't leak the
From: |
Paolo Bonzini |
Subject: |
[PATCH 1/6] block/vdi: When writing new bmap entry fails, don't leak the buffer |
Date: |
Wed, 17 Mar 2021 19:00:08 +0100 |
From: David Edmondson <david.edmondson@oracle.com>
If a new bitmap entry is allocated, requiring the entire block to be
written, avoiding leaking the buffer allocated for the block should
the write fail.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Message-Id: <20210309144015.557477-2-david.edmondson@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/vdi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/vdi.c b/block/vdi.c
index 5627e7d764..2a6dc26124 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -690,6 +690,7 @@ nonallocating_write:
logout("finished data write\n");
if (ret < 0) {
+ g_free(block);
return ret;
}
--
2.29.2
- [PATCH v5 0/6] coroutine rwlock downgrade fix, minor VDI changes, Paolo Bonzini, 2021/03/17
- [PATCH 3/6] coroutine/mutex: Store the coroutine in the CoWaitRecord only once, Paolo Bonzini, 2021/03/17
- [PATCH 5/6] test-coroutine: add rwlock upgrade test, Paolo Bonzini, 2021/03/17
- [PATCH 2/6] block/vdi: Don't assume that blocks are larger than VdiHeader, Paolo Bonzini, 2021/03/17
- [PATCH 1/6] block/vdi: When writing new bmap entry fails, don't leak the buffer,
Paolo Bonzini <=
- [PATCH 6/6] test-coroutine: Add rwlock downgrade test, Paolo Bonzini, 2021/03/17
- [PATCH 4/6] coroutine-lock: reimplement CoRwlock to fix downgrade bug, Paolo Bonzini, 2021/03/17
- Re: [PATCH v5 0/6] coroutine rwlock downgrade fix, minor VDI changes, Max Reitz, 2021/03/24
- Re: [PATCH v5 0/6] coroutine rwlock downgrade fix, minor VDI changes, Stefan Hajnoczi, 2021/03/24