]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/vm/vm_user.c
xnu-1504.9.17.tar.gz
[apple/xnu.git] / osfmk / vm / vm_user.c
index 7e68d60ca5a8ec4bea80077980293c8464257489..59c26ff7069c1eac5329d456aad46cd87894ba05 100644 (file)
@@ -2417,10 +2417,12 @@ redo_lookup:
 
 make_mem_done:
        if (user_handle != IP_NULL) {
-               ipc_port_dealloc_kernel(user_handle);
-       }
-       if (user_entry != NULL) {
-               kfree(user_entry, sizeof *user_entry);
+               /*
+                * Releasing "user_handle" causes the kernel object
+                * associated with it ("user_entry" here) to also be
+                * released and freed.
+                */
+               mach_memory_entry_port_release(user_handle);
        }
        return kr;
 }