BUG: Putenv() Function Causes Memory LeakID: Q235601
|
A memory leak results from calls to putenv in the following circumstances:
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
#include <stdlib.h>
void main()
{
for (;;) {
putenv( "MYVAR1=mystring" ); // Replaces string MYVAR1
// after first iteration.
putenv( "MYVAR2=mystring" ); // Creates and removes MYVAR2.
putenv( "MYVAR2=" ); //
putenv( "MYVAR3" ); // Invalid string missing "=".
}
}
Additional query words: kbvc400
Keywords : kbCRT kbVC500bug kbVC600bug kbDSupport kbGrpVCCompiler
Version : winnt:4.0,4.1,4.2,5.0,6.0
Platform : winnt
Issue type : kbbug
Last Reviewed: July 12, 1999