[plcrashreporter] push by landon.j.fuller@gmail.com - Fix leak of memory entry. on 2013-07-15 20:42 GMT

9 views
Skip to first unread message

codesite...@google.com

unread,
Jul 15, 2013, 4:42:21 PM7/15/13
to plcrashrepo...@googlegroups.com
Revision: 7753015ba995
Author: Landon Fuller <lan...@plausible.coop>
Date: Mon Jul 15 13:41:50 2013
Log: Fix leak of memory entry.

http://code.google.com/p/plcrashreporter/source/detail?r=7753015ba995

Modified:
/Source/PLCrashAsyncMObject.c

=======================================
--- /Source/PLCrashAsyncMObject.c Mon Jul 8 14:31:15 2013
+++ /Source/PLCrashAsyncMObject.c Mon Jul 15 13:41:50 2013
@@ -205,15 +205,15 @@
kt = vm_map(mach_task_self(), &target_address, entry_length, 0x0,
VM_FLAGS_FIXED|VM_FLAGS_OVERWRITE, mem_handle, 0x0, TRUE, VM_PROT_READ,
VM_PROT_READ, VM_INHERIT_COPY);
#endif /* !PL_HAVE_MACH_VM */

+ /* Drop the memory handle */
+ kt = mach_port_mod_refs(mach_task_self(), mem_handle,
MACH_PORT_RIGHT_SEND, -1);
+ if (kt != KERN_SUCCESS) {
+ PLCF_DEBUG("mach_port_mod_refs(-1) failed: %d", kt);
+ }
+
if (kt != KERN_SUCCESS) {
PLCF_DEBUG("vm_map() failure: %d", kt);
-
- /* Drop the memory handle */
- kt = mach_port_mod_refs(mach_task_self(), mem_handle,
MACH_PORT_RIGHT_SEND, -1);
- if (kt != KERN_SUCCESS) {
- PLCF_DEBUG("mach_port_mod_refs(-1) failed: %d", kt);
- }
-
+
/* Clean up the reserved pages */
kt = vm_deallocate(mach_task_self(), mapping_addr, total_size);
if (kt != KERN_SUCCESS) {
Reply all
Reply to author
Forward
0 new messages