Bug 2535

Summary: Potential leak of memory in bench-simulator.cc
Product: ns-3 Reporter: natale.patriciello
Component: generalAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: tomh
Priority: P5    
Version: unspecified   
Hardware: PC   
OS: Linux   
Attachments: Patch
Memleak patch
Style patch

Description natale.patriciello 2016-11-05 07:07:36 UTC
Created attachment 2649 [details]
Patch

I have checked the source file, there is a potential memory leak. Nothing very dramatic, but still an improvement.

Patch attached with also style fix. Detected through clang static analyzer.
Comment 1 Tom Henderson 2016-11-05 16:58:40 UTC
I suggest to separate whitespace changes and the bug fix into two patches.  The bug fix is a single statement.  The whitespace change is OK as a second step but please check the first change proposed.
Comment 2 natale.patriciello 2016-11-06 04:43:03 UTC
Created attachment 2655 [details]
Memleak patch

Thank you Tom, I separated them. This is for the memleak.
Comment 3 natale.patriciello 2016-11-06 04:43:42 UTC
Created attachment 2656 [details]
Style patch

Here the style patch.
Comment 4 natale.patriciello 2016-11-11 06:09:34 UTC
fixed in 12402:69bffcd3c8fb