summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2014-02-17 00:00:39 +0000
committerbdrewery <bdrewery@FreeBSD.org>2014-02-17 00:00:39 +0000
commit0db3f6b736bd00b9bb0338d5c6a2a1f2c8db8093 (patch)
tree6a97c25ca68700979516949ffacfbced5dda64a7 /contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
parentd8cb95cb17021344559f9414e80768f023fce14d (diff)
downloadFreeBSD-src-0db3f6b736bd00b9bb0338d5c6a2a1f2c8db8093.zip
FreeBSD-src-0db3f6b736bd00b9bb0338d5c6a2a1f2c8db8093.tar.gz
Fix M_FILEDESC leak in fdgrowtable() introduced in r244510.
fdgrowtable() now only reallocates fd_map when necessary. This fixes fdgrowtable() to use the same logic as fdescfree() for when to free the fd_map. The logic in fdescfree() is intended to not free the initial static allocation, however the fd_map grows at a slower rate than the table does. The table is intended to hold 20 fd, but its initial map has many more slots than 20. The slot sizing causes NDSLOTS(20) through NDSLOTS(63) to be 1 which matches NDSLOTS(20), so fdescfree() was assuming that the fd_map was still the initial allocation and not freeing it. This partially reverts r244510 by reintroducing some of the logic it removed in fdgrowtable(). Reviewed by: mjg Approved by: bapt (mentor) MFC after: 2 weeks
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud