Potential memory leak in sshd [detected by melton]

Ángel González keisial at gmail.com
Mon Feb 6 08:02:58 EST 2012


On 04/02/12 02:55, Zhenbo Xu wrote:
> The url below is the index of bug reports that are checked as real
> bugs manually.
>
> http://lcs.ios.ac.cn/~xuzb/bugsfound/memleak/openssh-5.9p1/realbugs/sshd/index.html
>
>
> Shall we fix these bugs? Or just let them go since they are not so serious?
>
> Hope for your replies!
The third error
Logic error    Memory leak    monitor.i    13658    3
seems like a good catch.
There should be a call to buffer_free(&logmsg); before the return -1 of
monitor_read_log.

Although it only happens if the client closed the socket, in which case
the next poll of
line 13702 should fail and monitor_read_log never called again.
So it probably only leaks once.

Attaching fix.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: monitor_read_log-buffer_free.patch
Type: text/x-patch
Size: 377 bytes
Desc: not available
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20120205/d139984d/attachment.bin>


More information about the openssh-unix-dev mailing list