Tcl Source Code

Check-in [2edd8ea296]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:* generic/tclAssemnbly.c: Plug another memory leak. [Bug 3384840] * generic/tclStrToD.c: Plug another memory leak. [Bug 3386975]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2edd8ea2964e06f3af29a9a73d2d6990ce963ba7
User & Date: kbk 2011-08-06 20:49:35
Context
2011-08-07
15:46
[Bug 3387082]: Plug memory leak in call chain introspection. check-in: 5f31ec3fcd user: dkf tags: trunk
2011-08-06
20:49
* generic/tclAssemnbly.c: Plug another memory leak. [Bug 3384840] * generic/tclStrToD.c: Plug anothe... check-in: 2edd8ea296 user: kbk tags: trunk
19:56
Plug another memory leak. [Bug 3384840] check-in: 81336419d0 user: kbk tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1
2
3

4
5
6
7
8
9
10
2011-08-06  Kevin B, Kenny  <[email protected]>

	* generic/tclAssemnbly.c: Plug another memory leak. [Bug 3384840]


2011-08-05  Kevin B. Kenny  <[email protected]>

	* generic/tclStrToD.c: Plugged a memory leak in double->string
	conversion. [Bug 3386975]

2011-08-05  Donal K. Fellows  <[email protected]>



>







1
2
3
4
5
6
7
8
9
10
11
2011-08-06  Kevin B, Kenny  <[email protected]>

	* generic/tclAssemnbly.c: Plug another memory leak. [Bug 3384840]
	* generic/tclStrToD.c: Plug another memory leak. [Bug 3386975]

2011-08-05  Kevin B. Kenny  <[email protected]>

	* generic/tclStrToD.c: Plugged a memory leak in double->string
	conversion. [Bug 3386975]

2011-08-05  Donal K. Fellows  <[email protected]>

Changes to generic/tclAssembly.c.

855
856
857
858
859
860
861




862
863
864






865
866
867
868
869
870



















871
872
873
874
875
876
877
    source = TclGetStringFromObj(objPtr, &sourceLen);
    TclInitCompileEnv(interp, &compEnv, source, sourceLen, NULL, 0);
    status = TclAssembleCode(&compEnv, source, sourceLen, TCL_EVAL_DIRECT);
    if (status != TCL_OK) {
	/*
	 * Assembly failed. Clean up and report the error.
	 */




	for (i = 0; i < compEnv.literalArrayNext; i++) {
	    TclReleaseLiteral(interp, compEnv.literalArrayPtr[i].objPtr);
	}






	for (i = 0; i < compEnv.auxDataArrayNext; i++) {
	    auxDataPtr = compEnv.auxDataArrayPtr + i;
	    if (auxDataPtr->type->freeProc != NULL) {
		(auxDataPtr->type->freeProc)(auxDataPtr->clientData);
	    }
	}



















	TclFreeCompileEnv(&compEnv);
	return NULL;
    }

    /*
     * Add a "done" instruction as the last instruction and change the object
     * into a ByteCode object. Ownership of the literal objects and aux data







>
>
>
>



>
>
>
>
>
>






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
    source = TclGetStringFromObj(objPtr, &sourceLen);
    TclInitCompileEnv(interp, &compEnv, source, sourceLen, NULL, 0);
    status = TclAssembleCode(&compEnv, source, sourceLen, TCL_EVAL_DIRECT);
    if (status != TCL_OK) {
	/*
	 * Assembly failed. Clean up and report the error.
	 */

	/*
	 * Free any literals that were constructed for the assembly.
	 */
	for (i = 0; i < compEnv.literalArrayNext; i++) {
	    TclReleaseLiteral(interp, compEnv.literalArrayPtr[i].objPtr);
	}

	/*
	 * Free any auxiliary data that was attached to the bytecode
	 * under construction.
	 */

	for (i = 0; i < compEnv.auxDataArrayNext; i++) {
	    auxDataPtr = compEnv.auxDataArrayPtr + i;
	    if (auxDataPtr->type->freeProc != NULL) {
		(auxDataPtr->type->freeProc)(auxDataPtr->clientData);
	    }
	}

	/*
	 * TIP 280. If there is extended command line information,
	 * we need to clean it up.
	 */

	if (compEnv.extCmdMapPtr != NULL) {
	    if (compEnv.extCmdMapPtr->type == TCL_LOCATION_SOURCE) {
		Tcl_DecrRefCount(compEnv.extCmdMapPtr->path);
	    }
	    for (i = 0; i < compEnv.extCmdMapPtr->nuloc; ++i) {
		ckfree(compEnv.extCmdMapPtr->loc[i].line);
	    }
	    if (compEnv.extCmdMapPtr->loc != NULL) {
		ckfree(compEnv.extCmdMapPtr->loc);
	    }
	    Tcl_DeleteHashTable(&(compEnv.extCmdMapPtr->litInfo));
	}

	TclFreeCompileEnv(&compEnv);
	return NULL;
    }

    /*
     * Add a "done" instruction as the last instruction and change the object
     * into a ByteCode object. Ownership of the literal objects and aux data

Changes to generic/tclStrToD.c.

4474
4475
4476
4477
4478
4479
4480



4481
4482
4483
4484
4485
4486
4487
TclFinalizeDoubleConversion(void)
{
    int i;

    ckfree(pow10_wide);
    for (i=0; i<9; ++i) {
	mp_clear(pow5 + i);



    }
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_InitBignumFromDouble --







>
>
>







4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
TclFinalizeDoubleConversion(void)
{
    int i;

    ckfree(pow10_wide);
    for (i=0; i<9; ++i) {
	mp_clear(pow5 + i);
    }
    for (i=0; i < 5; ++i) {
	mp_clear(pow5_13 + i);
    }
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_InitBignumFromDouble --