Closed
Bug 203764
Opened 22 years ago
Closed 18 years ago
Memory leak of 370 bytes from 1 block allocated in copy_environ, due to putenv()/setenv()
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: stephend, Unassigned)
References
Details
(Keywords: memory-leak)
Just starting up the latest trunk win32 debug under Purify with -edit, I see:
[W] MLK: Memory leak of 370 bytes from 1 block allocated in copy_environ
Distribution of leaked blocks
Allocation location
malloc_dbg [dbgheap.c:164]
copy_environ [setenv.c:335]
_crtsetenv [setenv.c:98]
putenv_lk [putenv.c:161]
putenv [putenv.c:78]
PR_MD_PUT_ENV [ntmisc.c:54]
*/
PRIntn _PR_MD_PUT_ENV(const char *name)
{
=> return(putenv(name));
}
PR_SetEnv [prenv.c:93]
nsGREDirServiceProvider::AddGRELocationToPath(void)
[nsGREDirServiceProvider.cpp:490]
XPCOM_SEARCH_KEY,
grePath,
path);
=> PR_SetEnv(mPathEnvString);
free(grePath);
}
nsGREDirServiceProvider::nsGREDirServiceProvider(void)
[nsGREDirServiceProvider.cpp:86]
nsGREDirServiceProvider::nsGREDirServiceProvider()
: mPathEnvString(nsnull)
{
=> AddGRELocationToPath();
}
nsGREDirServiceProvider::~nsGREDirServiceProvider()
GRE_Startup [nsXPCOMGlue.cpp:231]
return rv;
}
=> nsGREDirServiceProvider *provider = new nsGREDirServiceProvider();
if ( !provider ) {
NS_WARNING("GRE_Startup failed");
XPCOMGlueShutdown();
Comment 1•22 years ago
|
||
huh. I wonder if this leak is unavoidable, or at least that its a libc leak. it
looks like the system is leaking the data in the putenv(), and I'm guessing the
library is the only one with the capability to fix it.
Comment 2•22 years ago
|
||
http://lxr.mozilla.org/nspr/source/nsprpub/pr/include/prenv.h#101
i guess, we could reset the env right before we exit.
Updated•18 years ago
|
Assignee: dougt → nobody
QA Contact: scc → xpcom
Comment 3•18 years ago
|
||
I don't know if this is still valid or not...
Comment 4•18 years ago
|
||
This is not worth fixing. envvar settings must be static, and doing shutdown resets isn't worth the effort.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WONTFIX
Comment 5•16 years ago
|
||
I assume bug 114646 was this bug;
and bug 454842 comment 7 testcase is too...
You need to log in
before you can comment on or make changes to this bug.
Description
•