diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-01 11:38:03 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-01 11:38:03 +0100 |
commit | 255112b27b106f70d9c9ef38cd8dff62777ba657 (patch) | |
tree | 9d4dd623ce9ae4c6e2b0170a4562d06fd4a4bbdd /boot | |
parent | a9c74187eff3dcd7aa23a735e8ef07abf1546514 (diff) | |
download | hurd-255112b27b106f70d9c9ef38cd8dff62777ba657.tar.gz hurd-255112b27b106f70d9c9ef38cd8dff62777ba657.tar.bz2 hurd-255112b27b106f70d9c9ef38cd8dff62777ba657.zip |
boot: Fix memory leak on S_io_read error
Diffstat (limited to 'boot')
-rw-r--r-- | boot/boot.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/boot/boot.c b/boot/boot.c index 1f02947f..0a7091e3 100644 --- a/boot/boot.c +++ b/boot/boot.c @@ -1460,6 +1460,8 @@ S_io_read (mach_port_t object, if (amount > *datalen) *data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); *datalen = read (0, *data, amount); + if (*datalen == -1) + munmap (*data, amount); unlock_readlock (); return *datalen == -1 ? errno : 0; } |