From dfe3c8728b306091c3f9df0ccd581006922ae378 Mon Sep 17 00:00:00 2001 From: Damien Zammit via Bug reports for the GNU Hurd Date: Sat, 28 Dec 2024 06:38:41 +0000 Subject: rumpdisk: Deallocate buffers in write during failure paths Message-ID: <20241228063834.709656-1-damien@zamaudio.com> --- rumpdisk/block-rump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rumpdisk/block-rump.c b/rumpdisk/block-rump.c index 309495dd..01dfd389 100644 --- a/rumpdisk/block-rump.c +++ b/rumpdisk/block-rump.c @@ -376,6 +376,7 @@ rumpdisk_device_write (void *d, mach_port_t reply_port, if (written < 0) { + vm_deallocate (mach_task_self (), (vm_address_t) data, count); pthread_rwlock_unlock (&rumpdisk_rwlock); return rump_errno2host (err); } @@ -405,6 +406,7 @@ rumpdisk_device_write (void *d, mach_port_t reply_port, if (done < 0) { + vm_deallocate (mach_task_self (), (vm_address_t) data, count); pthread_rwlock_unlock (&rumpdisk_rwlock); return rump_errno2host (errno); } -- cgit v1.2.3