Bug 1849 - Memory Leak in authmethod_get
Summary: Memory Leak in authmethod_get
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 5.6p1
Hardware: All All
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_9
  Show dependency treegraph
 
Reported: 2011-01-23 23:55 AEDT by David Gosselin
Modified: 2023-01-13 13:18 AEDT (History)
2 users (show)

See Also:


Attachments
SSH Memory Leak Patch (673 bytes, patch)
2011-01-23 23:55 AEDT, David Gosselin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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