.
D 2003-05-06T12:07:49
J assignee hobbs
J cmimetype text/plain
J comment --------\n\ngeneric/tclDate.c\n\n1.\sShouldn't\sthis\sfile\sbe\susing\sckalloc/ckrealloc?\n2.\sThe\sfollowing\svariables\sare\sallocated\sand\sare\s\nnever\sfreed:\n\nint\s*TclDates;\nYYSTYPE\s*TclDatev;\n\n--------\n\nwin/tclAppInit.c,\sline\s269:\n\n\s\s\s\sargSpace\s=\s(char\s*)\sTcl_Alloc(\n\s\s\s\s(unsigned)\s(size\s*\ssizeof(char\s*)\s+\sstrlen\n(cmdLine)\s+\s1));\n\n1.\sShouldn't\sthis\salso\sbe\sckalloc?\n2.\sThis\sis\sa\slocal\svariable\sin\sthe\sfunction.\n3.\sThis\smemory\sis\snever\sfreed.\n\n--------\n\ntools/encoding/txt2enc.c\n\n1.\sMemory\sallocated\svia\smalloc\son\sline\s#181\sand\s\n#204\sis\snever\sfreed.\n2.\sSince\sthis\sis\sa\sstand-alone\sutility,\sit\sshould\sbe\s\nfairly\strivial\sto\sfix\sthese\sleaks\swith\sthe\sfollowing\s\ncode\sbefore\s"return\s0"\son\sline\s#243:\n\n\s\s\s\sfor\s(hi\s=\s0;\shi\s<\s256;\shi++)\s{\nif\s(toUnicode[hi]\s!=\sNULL)\s{\n\s\s\s\sfree(toUnicode[hi]);\n\s\s\s\s\s\s\s\s\s\s\s\stoUnicode[hi]\s=\sNULL;\n}\n\s\s\s\s}\n\n--------\n\ngeneric/tclThreadAlloc.c\n\n1.\sWe\shave\sthe\sstatic\sfile\svariables:\n\nstatic\sTcl_Mutex\s*listLockPtr;\nstatic\sTcl_Mutex\s*objLockPtr;\n\n2.\sThey\sare\sallocated\svia\sTclpNewAllocMutex,\swhich\s\nBOTH\sallocates\smemory\svia\smalloc\sAND\scalls\s\nInitializeCriticalSection\son\sthe\scontained\scritical\s\nsection.\n\n3.\sNeither\sthe\sblock\sof\smemory\snor\sthe\scritical\s\nsection\sare\sever\sfreed.\n\n4.\sThere\sneeds\sto\sbe\sa\snew\sfunction\sin\s\ntclThreadAlloc.c,\s\ncalled\s"TclFinalizeThreadAllocSubsystem",\sthat\s\nfrees\sthese\smutexes\s(probably\sby\scalling\san\s\nappropriate\splatform\sspecific\sfunc,\syet\sto\sbe\s\ncreated,\sperhaps\scalled\s"TclpNewFreeMutex")\sand\s\nthen\scalls\sthe\s"TclpFinalizeThreadAllocSubsystem"\s\nfunction\sfor\sthe\splatform\sspecific\scleanup\s(i've\s\ncreated\sthe\sWin32\sversion\sof\sthis\sfunction\sin\smy\s\nnew\spatch\s#731356).\n\n5.\sAnother\sleak\s(see\sSF\sbug\s#731754,\sfixed\sin\smy\s\npatch\s#731356)\sinvolves\sthis\scode,\snear\sline\s#279:\n\n#ifdef\sWIN32\n\s\s\s\sTlsFree((DWORD)\scachePtr);\n#else\n\s\s\s\sfree(cachePtr);\n#endif\n\nThe\sabove\scode\sis\sentirely\sincorrect\sfor\sWin32.\s\sI\s\nbelieve\sit\sshould\salways\sbe\s"free(cachePtr);"\sas\s\ncachePtr\sis\sNOT\sa\sTLS\sindex,\sit\sis\sa\sblock\sof\s\nmemory.\n\n6.\sYet\sanother\sleak\s(also\sfixed\sin\smy\spatch\s\n#731356)\sinvolves\sfreeing\sthe\sactual\sTLS\sindex\s\nused\sby\sthe\sthreaded\smemory\sallocator\s(what\sthe\s\nabove\sincorrect\scode\swas\sTRYING\sand\sfailing\sto\sdo).\n\n--------\n
J foundin None
J priority 5\sMedium
J resolution None
J status Open
J submitter mistachkin
J subsystem 41.\sMemory\sAllocation
J title various\smemory\sleaks...
J type Bug
K 733221ffffffffffffffffffffffffffffffffff
U mistachkin
Z 8e29d63e09d310a5a3022032bd107b70