.
D 2000-10-26T01:10:58
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s6041\sBug\nVersion:\s8.3.1\nSubmitDate:\s'2000-07-24'\nLastModified:\s'2000-07-25'\nSeverity:\sMED\nStatus:\sReleased\nSubmitter:\stechsupp\nChangedBy:\sericm\nOS:\sAll\nFixedDate:\s'2000-07-25'\nFixedInVersion:\s8.4a2\nClosedDate:\s'2000-07-24'\n\n\nName:\n\nmarc\sherbert\n\n\nReproducibleScript:\n\nSimple\sTcl_DStringFree()\scall\smissing\n\nPossible\smemory\sleak\n\nPatch\sself-explanatory\n\n\nPatch:\n\n===================================================================\n\nRCS\sfile:\sRCS/tclWinPipe.c,v\n\nretrieving\srevision\s1.1\n\ndiff\s-c\s-r1.1\stclWinPipe.c\n\n***\stclWinPipe.c\s\s\s\s\s\s\s\s2000/07/24\s09:38:53\s\s\s\s\s1.1\n\n---\stclWinPipe.c\s\s\s\s\s\s\s\s2000/07/24\s09:41:09\n\n***************\n\n***\s1569,1574\s****\n\n---\s1569,1575\s----\n\n\s\s\s\s\s\s\s\s\s\s\s\sTcl_DStringAppend(&ds,\s"\\"",\s1);\n\n\s\s\s\s\s\s\s\s}\n\n\s\s\s\s\s\s}\n\n+\s\s\s\s\sTcl_DStringFree(linePtr);\n\n\s\s\s\s\s\sTcl_WinUtfToTChar(Tcl_DStringValue(&ds),\sTcl_DStringLength(&ds),\slinePtr);\n\n\s\s\s\s\s\sTcl_DStringFree(&ds);\n\n\s\s}\n\n\nPatchFiles:\n\nwin/tclWinPipe.c\n\n\n\n\nI\sdon't\sthink\sthat\sthis\smodification\sis\snecessary;\sthe\sDString\sreferred\sto\sas\slinePtr\sin\sthe\sfunction\sindicated\sabove\sis\smanaged\sby\sthe\scalling\sfunction,\snot\sby\sBuildCommandLine\sitself.\s\sSee\sthe\sfunction\sTclpCreateProcess,\sat\sline\s1232\sof\stclWinPipe.c.\s\sThe\sDString\sis\sfree'd\sat\sthat\spoint.\n\n\s\s\sEric\sMelski\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sThe\sOther\sTcl\sGuy\n\s\s\sericm\sat\sajubasolutions.com\s\s\s\s\s\s\s\s\s\s\s\sAjuba\sSolutions\n\n--\s07/24/2000\sericm\n\nÉric,\n\nI\sthink\syou're\swrong.\sLet's\ssee\sthe\sTcl\sman\spages\s:\n\n>\s\s\s\s\s\sTcl_DStringInit\sinitializes\sa\sdynamic\sstring\sto\szero\n>\s\s\s\s\s\slength.\sThe\sTcl_DString\sstructure\smust\shave\sbeen\sallocated\sby\n>\s\s\s\s\s\sthe\scaller.\sNo\sassumpÂ\stions\sare\smade\sabout\sthe\scurrent\n>\s\s\s\s\s\sstate\sof\sthe\sstructure;\sanything\salready\sin\sit\sis\sdiscarded.\n\nAnd\sin\sparticular\s:\n\n>\s\s\s\s\s\sIf\sthe\sstructure\shas\sbeen\sused\spreviously,\sTcl_DStringFree\n>\s\s\s\s\s\sshould\sbe\scalled\sfirst\sto\sfree\sup\sany\smemory\sallocated\sfor\sthe\n>\s\s\s\s\s\sold\sstring.\n\nThis\sis\sbecause\sa\s"brutal"\sTcl_DStringInit\s()\smay\sleave\sthe\spossibly\nalready\sdynamic\sallocated\smemory\sunreferenced.\n\n=>\sgarbage,\smemory\sleak.\n\nThe\sTcl_DStringFree\s()\syou\smention\s(tclWinPipe.c:1232)\sis\stoo\slate.\sA\n"brutal"\sTcl_DStringInit\s()\shas\soccured\sbefore,\sthanks\sto\sthe\nTcl_WinUtfToTChar()\scall\sseen\sin\smy\spatch\sjust\sabove.\n\n--------------------\n\nIn\sshort\s:\nBuildCommandLine\s()\sgets\sa\sarguments\salready\sinitialized\s(we\sboth\nagree\son\sthat\spoint)\s:\n\nstatic\svoid\nBuildCommandLine(\n\s\s\s\s\s...\n\s\s\s\sTcl_DString\s*linePtr)\s\s\s\s\s\s\s/*\sInitialized\sTcl_DString\sthat\sreceives\sthe\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\scommand\sline\s(TCHAR).\s*/\n)\n\nBut\sit\sdoes\sa\ssecond\s"over-Tcl_DStringInit\s()"\son\sit,\svia\nTcl_WinUtfToTChar(),\swithout\sfreeing\sit\sfirst,\sand\sthis\sis\swrong.\n\nSincerely,\n\n--\s\nMarc\sHerbert\s\s\s\s\s\s\s\s\s\s\s\s\s|\sGIE\sDyade\s(Bull/INRIA)\[email protected]\s\s\s\s|\s\s\shttp://www.dyade.fr/\ntel:\s+33\s4\s7661\s5258\s\s\s|\sVASY\sProject\s\nfax:\s+33\s4\s7661\s5252\s\s\s|\s\s\shttp://www.inrialpes.fr/vasy\n\n----\n\nYes,\syou\sare\sright.\s\sThanks\sfor\sstraightening\sme\sout.\s\sI've\sapplied\syour\spatch\sand\scommitted\sit\sto\sCVS.\s\sThe\sfix\swill\sbe\sincluded\sin\sTcl\s8.4a2.\n\n\s\s\sEric\sMelski\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sThe\sOther\sTcl\sGuy\n\s\s\sericm\sat\sajubasolutions.com\s\s\s\s\s\s\s\s\s\s\s\sAjuba\sSolutions\n\n--\s07/25/2000\sericm\n\n
J foundin obsolete:\s8.3.1
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title missing\sTcl_DStringFree()\s\sin\swin/tclWinPipe.c\s(very\ssimple)
J type Bug
K 219112ffffffffffffffffffffffffffffffffff
U nobody
Z 27183273cc5e0e4d23c25d31b940f0e1