]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r230874:
authortrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 12 Feb 2012 07:56:07 +0000 (07:56 +0000)
committertrociny <trociny@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 12 Feb 2012 07:56:07 +0000 (07:56 +0000)
commit7297b969ff504d7a2f404e2db00f1a9c30c8f2ba
tree2a491739753d782732728540331b6296567a9d87
parentae4994884c1d943c3089a6546ed9333424b09368
MFC r230874:

Try to avoid ambiguity when sysctl returns ENOMEM additionally
checking the returned oldlen: when ENOMEM is due to the supplied
buffer being too short the return oldlen is equal to buffer size.

Without this additional check sockstat gets stuck in loop leaking the
memory if the returned ENOMEM was due the exceeded memorylocked
limit. This is easily can be observed running `limits -l 1k sockstat'.

Submitted by: Andrey Zonov <andrey zonov org>

git-svn-id: svn://svn.freebsd.org/base/stable/8@231554 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.bin/sockstat/sockstat.c