commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 37/98: libshouldbeinlibc: fix minor port leak in maptime_map


From: Samuel Thibault
Subject: [hurd] 37/98: libshouldbeinlibc: fix minor port leak in maptime_map
Date: Tue, 14 Jan 2014 02:00:00 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 88be9e7481f167d139b4f3c981368b6071c61384
Author: Justus Winter <address@hidden>
Date:   Wed Nov 27 10:27:29 2013 +0100

    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.
---
 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
     {

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]