[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/6] block/vdi: When writing new bmap entry fails, don't leak
From: |
David Edmondson |
Subject: |
[PATCH v2 1/6] block/vdi: When writing new bmap entry fails, don't leak the buffer |
Date: |
Tue, 9 Mar 2021 14:40:10 +0000 |
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>
---
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.30.1
- [PATCH v2 0/6] coroutine rwlock downgrade fix, minor VDI changes, David Edmondson, 2021/03/09
- [PATCH v2 1/6] block/vdi: When writing new bmap entry fails, don't leak the buffer,
David Edmondson <=
- [PATCH v2 2/6] block/vdi: Don't assume that blocks are larger than VdiHeader, David Edmondson, 2021/03/09
- [PATCH v2 3/6] coroutine/mutex: Store the coroutine in the CoWaitRecord only once, David Edmondson, 2021/03/09
- [PATCH v2 6/6] coroutine/rwlock: Avoid thundering herd when unlocking, David Edmondson, 2021/03/09
- [PATCH v2 5/6] coroutine/rwlock: Wake writers in preference to readers, David Edmondson, 2021/03/09
- [PATCH v2 4/6] test-coroutine: Add rwlock downgrade test, David Edmondson, 2021/03/09