You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2008/05/20 21:23:55 UTC

[jira] Updated: (STDCXX-583) purify reports memory leak inside rw_putenv()

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

Martin Sebor updated STDCXX-583:
--------------------------------

    Affects Version/s: 4.2.0
        Fix Version/s: 4.3

Scheduled for 4.3 when we'll need to re-run Purify against newly added code and assigned to Travis.

> purify reports memory leak inside rw_putenv()
> ---------------------------------------------
>
>                 Key: STDCXX-583
>                 URL: https://issues.apache.org/jira/browse/STDCXX-583
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: Test Driver
>    Affects Versions: 4.2.0
>            Reporter: Travis Vitek
>            Priority: Minor
>             Fix For: 4.3
>
>         Attachments: 0.printf.log
>
>
> rw_putenv() uses putenv() to add variables to the environment. Unfortunately putenv() actually places the user provided string into the environment, so the string cannot be deallocated immediately. The result is false positive memory leaks in tests that use rw_putenv().
> One solution would be to use setenv() and unsetenv() on platforms that support them. This avoids the memory leak. Another option would be to have rw_putenv() track the environment strings that were added, then remove and deallocate them when the test driver is taken down.

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