diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-11-27 10:27:29 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-11-28 13:13:32 +0100 |
commit | 88be9e7481f167d139b4f3c981368b6071c61384 (patch) | |
tree | 79b51f8e32d88f8badcc119c3a64746c92ad7480 /libshouldbeinlibc | |
parent | 2ef89abb8cbafab865baa2399e2641879b495aea (diff) |
libshouldbeinlibc: fix minor port leak in maptime_map
Deallocate the device port after creating the mapping. The mapping is
independent of the device port.
* libshouldbeinlibc/maptime.c (maptime_map): Deallocate device port.
Diffstat (limited to 'libshouldbeinlibc')
-rw-r--r-- | libshouldbeinlibc/maptime.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libshouldbeinlibc/maptime.c b/libshouldbeinlibc/maptime.c index ca35c6cf..f0b69db4 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 { |