Issue Details (XML | Word | Printable)

Key: STDCXX-583
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Travis Vitek
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

purify reports memory leak inside rw_putenv()

Created: 09/Oct/07 10:51 PM   Updated: 11/Jul/09 12:06 AM
Return to search
Component/s: Test Driver
Affects Version/s: 4.2.0
Fix Version/s: 4.3.0

Time Tracking:
Original Estimate: 2h
Original Estimate - 2h
Remaining Estimate: 2h
Remaining Estimate - 2h
Time Spent: Not Specified
Remaining Estimate - 2h

File Attachments:
  Size
Text File Licensed for inclusion in ASF works 0.printf.log 2007-10-09 10:52 PM Travis Vitek 11 kB

Severity: Resource Leak


 Description  « Hide
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.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.