Closed Bug 94113 Opened 23 years ago Closed 23 years ago

memory leak of prlog.c of all PRLogModuleInfo structures

Categories

(NSPR :: NSPR, defect)

4.1.2
x86
Windows 2000
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 54353

People

(Reporter: jeff, Assigned: wtc)

Details

(Keywords: memory-leak)

there is no mechanism for freeing any of the PRLogModuleInfo structures
either individually or when the log file is cleaned up.  hence, they are
all leaked.

consider adding something like the following to the 
bottom of _PR_LogCleanup() in nsprpub/pr/src/io/prlog.c

    {
	PRLogModuleInfo * lm = logModules;
	while (lm)
	{
	    PRLogModuleInfo * next = lm->next;
	    if (lm->name)
		PR_Free((/*const*/ char *)lm->name);
	    PR_Free(lm);
	    lm = next;
	}
	logModules = NULL;
    }

or creating a special LogModule cleanup function and calling
from PR_Cleanup() in nsprpub/pr/src/misc/prinit.c (see the XXX
comment near the bottom of the function).

granted this only affects debug builds (thus the reduced severity),
but it does generate extra noise for the leak-testing tools.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: mlk

*** This bug has been marked as a duplicate of 54353 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.