[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/11] libshouldbeinlibc: fix minor port leak in maptime_map
From: |
Justus Winter |
Subject: |
[PATCH 01/11] libshouldbeinlibc: fix minor port leak in maptime_map |
Date: |
Wed, 27 Nov 2013 13:31:08 +0100 |
Deallocate the device port after creating the mapping. The mapping is
independent of the device port.
* libshouldbeinlibc/maptime.c (maptime_map): Deallocate device port.
---
libshouldbeinlibc/maptime.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libshouldbeinlibc/maptime.c b/libshouldbeinlibc/maptime.c
index ca35c6c..f0b69db 100644
--- a/libshouldbeinlibc/maptime.c
+++ b/libshouldbeinlibc/maptime.c
@@ -51,6 +51,10 @@ maptime_map (int use_mach_dev, char *dev_name,
return err;
err = device_map (device, VM_PROT_READ, 0, sizeof *mtime, &memobj, 0);
+
+ /* Deallocate the device port. The mapping is independent of
+ this port. */
+ mach_port_deallocate (mach_task_self (), device);
}
else
{
--
1.7.10.4
- [PATCH 01/11] libshouldbeinlibc: fix minor port leak in maptime_map,
Justus Winter <=
- [PATCH 03/11] proc: update comments, Justus Winter, 2013/11/27
- [PATCH 04/11] libports: improve error handling in ports_reallocate_port, Justus Winter, 2013/11/27
- [PATCH 02/11] init: fix port leak, Justus Winter, 2013/11/27
- [PATCH 05/11] libports: improve error handling in ports_reallocate_from_external, Justus Winter, 2013/11/27
- [PATCH 06/11] libports: improve error handling in ports_transfer_right, Justus Winter, 2013/11/27