Bug 2182 - getopt(3) command-line arguments memleaks
Summary: getopt(3) command-line arguments memleaks
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 6.4p1
Hardware: All All
: P5 enhancement
Assignee: Darren Tucker
URL:
Keywords:
Depends on:
Blocks: V_7_2
  Show dependency treegraph
 
Reported: 2013-12-11 01:23 AEDT by Tiago Cunha
Modified: 2016-08-02 10:41 AEST (History)
1 user (show)

See Also:


Attachments
Plug getopt(3) command-line arguments memleaks (1.56 KB, application/octet-stream)
2013-12-11 01:23 AEDT, Tiago Cunha
no flags Details
Plug getopt(3) command-line arguments memleaks (2.38 KB, patch)
2013-12-11 01:28 AEDT, Tiago Cunha
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tiago Cunha 2013-12-11 01:23:21 AEDT
Created attachment 2386 [details]
Plug getopt(3) command-line arguments memleaks

Some options, when used more than once, are currently leaking memory.
For instance:
    $ ssh -Elog1 -Elog2 -carcfour -caes128-ctr

I've decided to remove the xstrdup call and used a simple assignment to optarg when specifying a log file, instead of freeing it previously, since it's only used once in log_redirect_stderr_to.
Comment 1 Tiago Cunha 2013-12-11 01:27:10 AEDT
I'll just use the Miscellaneous component instead of creating a specific bug to address the same memory leaks in the daemon. Hope that's alright.
Comment 2 Tiago Cunha 2013-12-11 01:28:26 AEDT
Created attachment 2387 [details]
Plug getopt(3) command-line arguments memleaks
Comment 3 Darren Tucker 2015-06-05 14:18:44 AEST
Add to the list for 7.0
Comment 4 Damien Miller 2015-08-11 22:59:11 AEST
Retarget pending bugs to openssh-7.1
Comment 5 Darren Tucker 2015-09-04 18:22:35 AEST
Patch has been applied and will be in 7.2.  Thanks!
Comment 6 Damien Miller 2016-08-02 10:41:29 AEST
Close all resolved bugs after 7.3p1 release