By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,682 Members | 1,980 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,682 IT Pros & Developers. It's quick & easy.

Memory leak in std::string

P: n/a
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 ?

--
Sergey Tursanov _g***@hippo.ru
to send me an email remove underscores in the address above
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> 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>

--
Sergey Tursanov _g***@hippo.ru
to send me an email remove underscores in the address above
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.