Bug 1849

Summary: Memory Leak in authmethod_get
Product: Portable OpenSSH Reporter: David Gosselin <djgosselin>
Component: sshAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: normal CC: djm, dtucker
Priority: P2    
Version: 5.6p1   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 1845    
Attachments:
Description Flags
SSH Memory Leak Patch none

Description David Gosselin 2011-01-23 23:55:59 AEDT
Created attachment 1982 [details]
SSH Memory Leak Patch

Code inspection revealed a memory leak in the authmethod_get function.  authmethod_get calls the function match_list which in turn creates a string on the heap and returns it to authmethod_get.  authmethod_get does not free the returned buffer containing the string once it has finished with it (leaving the string on the heap).  The attached patch fixes this memory leak.
Comment 1 Darren Tucker 2011-05-06 11:15:34 AEST
Seems reasonable (minor style nit: xfree should be on another line, indented.  will fix before committing).
Comment 2 Damien Miller 2011-05-06 12:06:01 AEST
patch applied - thanks. This will be in OpenSSH 5.9
Comment 3 Damien Miller 2011-09-06 15:33:11 AEST
close resolved bugs now that openssh-5.9 has been released