stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-579) purify reports memory leaked by strstreambuf example
Date Fri, 05 Oct 2007 19:35:50 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532758
] 

Martin Sebor commented on STDCXX-579:
-------------------------------------

We should not forget that the purpose of the example is to demo the strstreambuf class, not
strstream or other higher-level classes.

> purify reports memory leaked by strstreambuf example
> ----------------------------------------------------
>
>                 Key: STDCXX-579
>                 URL: https://issues.apache.org/jira/browse/STDCXX-579
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Examples
>            Reporter: Travis Vitek
>            Assignee: Travis Vitek
>            Priority: Minor
>             Fix For: 4.2.1
>
>         Attachments: stdcxx-579.patch
>
>
> The example calls out.rdbuf()->str() which calls freeze(). If the buffer if frozen,
the destructir is not allowed to free the memory [D.7.1.2 p8].
> ****  Purify instrumented ./strstreambuf (pid 27069)  ****
> Purify: Searching for all memory leaks...
> Memory leaked: 200 bytes (100%); potentially leaked: 0 bytes (0%)
> MLK: 200 bytes leaked at 0x80c01d8
>   * This memory was allocated from:
> 	malloc         [rtlib.o]
> 	operator new(unsigned) [libstd15d.so]
> 	operator new [](unsigned) [libstd15d.so]
> 	std::strstreambuf::setbuf(char*, int) [strstream.cpp:292]
> 	std::basic_streambuf<char, std::char_traits<char> >::pubsetbuf(char*, int)
[streambuf:91]
> 	main           [strstreambuf.cpp:78]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message