You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Farid Zaripov (JIRA)" <ji...@apache.org> on 2007/11/12 15:44:52 UTC

[jira] Resolved: (STDCXX-580) purify reports memory leaked by strstream example

     [ https://issues.apache.org/jira/browse/STDCXX-580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Farid Zaripov resolved STDCXX-580.
----------------------------------

    Resolution: Fixed

> purify reports memory leaked by strstream example 
> --------------------------------------------------
>
>                 Key: STDCXX-580
>                 URL: https://issues.apache.org/jira/browse/STDCXX-580
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Examples
>    Affects Versions: 4.2.0
>            Reporter: Travis Vitek
>            Assignee: Travis Vitek
>            Priority: Minor
>             Fix For: 4.2.1
>
>         Attachments: stdcxx-580.patch
>
>
> The example calls inout.str() which calls freeze(). If the streams streambuf if frozen, the destructor is not allowed to free the memory [D.7.1.2 p8]. 
> ****  Purify instrumented ./strstream (pid 21780)  ****
> Purify: Searching for all memory leaks...
> Memory leaked: 128 bytes (1.15%); potentially leaked: 0 bytes (0%)
> MLK: 128 bytes leaked at 0x40027788
>   * This memory was allocated from:
> 	malloc         [rtlib.o]
> 	__nWa__FuL     [libCsup_v2.2]
> 	operator new[](unsigned long) [rtlib.o]
> 	std::strstreambuf::setbuf(char *,long) [strstream.cpp:294]
> 	std::strstreambuf::overflow(int) [strstream.cpp:85]
> 	std::basic_streambuf<char,std::char_traits<char>>::xsputn(const char *,long) [streambuf.cc:144]

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