Memory leak in std::string

S

Sergey Tursanov

Hello all !
When I use code below and check my program with various memory
leak detection tools I get message about memory leaks in stl_alloc.h.

#include <string>

int main()
{
std::string s = ""; // that string of code causes memory leaks
return 0;
}

I use gcc 2.95.2 in Linux Debian 2.2r5. I try other STL (from SGI) -- memory
leak was in the same place. I use various memory debugging tols (e.g.
ccmalloc,
mtrace) -- all of them showed memory leaks.
Can anybody ask me what it means and why it happens ?
 
S

Sergey Tursanov

Hello all !
When I use code below and check my program with various memory
leak detection tools I get message about memory leaks in stl_alloc.h.

#include <string>

int main()
{
std::string s = ""; // that string of code causes memory leaks
return 0;
}


Thanks a lot to Mike Krasnik. He answer my question in thread
<"memory leaks" in std::vector container>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top