aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit via Bug reports for the GNU Hurd <bug-hurd@gnu.org>2024-12-28 06:38:41 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-28 10:01:58 +0100
commitdfe3c8728b306091c3f9df0ccd581006922ae378 (patch)
treec98960acb11bf1750605c6b0716e670dbb9013cc
parentb8e4d46796380ea42448e54bcc46e7eff1a1ad45 (diff)
downloadhurd-dfe3c8728b306091c3f9df0ccd581006922ae378.tar.gz
hurd-dfe3c8728b306091c3f9df0ccd581006922ae378.tar.bz2
hurd-dfe3c8728b306091c3f9df0ccd581006922ae378.zip
rumpdisk: Deallocate buffers in write during failure paths
Message-ID: <20241228063834.709656-1-damien@zamaudio.com>
-rw-r--r--rumpdisk/block-rump.c2
1 files changed, 2 insertions, 0 deletions
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);
}