Bug 2535 - Potential leak of memory in bench-simulator.cc
Potential leak of memory in bench-simulator.cc
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: general
unspecified
PC Linux
: P5 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-05 07:07 UTC by natale.patriciello
Modified: 2016-11-11 06:09 UTC (History)
1 user (show)

See Also:


Attachments
Patch (5.28 KB, patch)
2016-11-05 07:07 UTC, natale.patriciello
Details | Diff
Memleak patch (457 bytes, patch)
2016-11-06 04:43 UTC, natale.patriciello
Details | Diff
Style patch (3.98 KB, patch)
2016-11-06 04:43 UTC, natale.patriciello
Details | Diff

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