JoaoMGomes / libjingle

Automatically exported from code.google.com/p/libjingle
0 stars 0 forks source link

Memory leaks in GetGlobalRng() - helpers.cc #296

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call InitRandom
2. exit
3.

What is the expected output? What do you see instead?
Expected output is no memory leaks.
I see 2 memory leaks (one of 4 bytes and one of 12 bytes) due to the fact that 
the static variable
global_rng is declared as follow (without macro)

static scoped_ptr<RandomGenerator> global_rng = *new ( new 
SecureRandomGenerator() );

What version of the product are you using? On what operating system?
libjingle svn latest. Windows. Visual Studio 2008

Please provide any additional information below.

declaring global_rng as follows, memory leaks disappear

static scoped_ptr<RandomGenerator> global_rng (new SecureRandomGenerator() );

Original issue reported on code.google.com by f.dellab...@gmail.com on 2 Feb 2012 at 11:37