Tcl Source Code

Check-in [50703055aa]
Login

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

Overview
Comment:avoid possible leaking on tzName-object in error case (most impossible resp. rarely, but nevertheless better don't return directly).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sebres-8-6-clock-speedup-cr2
Files: files | file ages | folders
SHA3-256:50703055aaed3bc77fa643c5dc082c6d86ead1dd73dd17e14367ced52d0cec94
User & Date: sebres 2019-01-10 13:55:20
Context
2019-01-10
14:43
merge 8.6 check-in: 1de35d1115 user: sebres tags: sebres-8-6-clock-speedup-cr2
13:55
avoid possible leaking on tzName-object in error case (most impossible resp. rarely, but nevertheles... check-in: 50703055aa user: sebres tags: sebres-8-6-clock-speedup-cr2
13:52
remove unneeded dependencies (taken along by pack-porting, not needed in mod now) check-in: 9e8dec1306 user: sebres tags: sebres-8-6-clock-speedup-cr2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclClock.c.

3630
3631
3632
3633
3634
3635
3636
3637

3638
3639
3640
3641
3642
3643
3644
....
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
	/* Use compiled version of FreeScan - */

	/* [SB] TODO: Perhaps someday we'll localize the legacy code. Right now, it's not localized. */
	if (opts.localeObj != NULL) {
	    Tcl_SetObjResult(interp,
		Tcl_NewStringObj("legacy [clock scan] does not support -locale", -1));
	    Tcl_SetErrorCode(interp, "CLOCK", "flagWithLegacyFormat", NULL);
	    return TCL_ERROR;

	}
	ret = ClockFreeScan(&yy, objv[1], &opts);
    }
    else {
	/* Use compiled version of Scan - */

	ret = ClockScan(&yy, objv[1], &opts);
................................................................................
    ret = ClockScanCommit(&yy, &opts);
    if (ret != TCL_OK) {
	goto done;
    }

    /* Apply validation rules, if expected */
    if ( (opts.flags & CLF_VALIDATE) ) {
	if (ClockValidDate(&yy, &opts, 
		opts.formatObj == NULL ? 2 : 3) != TCL_OK) {
	    return TCL_ERROR;
	}
    }

done:

    Tcl_UnsetObjRef(yy.date.tzName);








|
>







 







|
|
|







3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
....
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
	/* Use compiled version of FreeScan - */

	/* [SB] TODO: Perhaps someday we'll localize the legacy code. Right now, it's not localized. */
	if (opts.localeObj != NULL) {
	    Tcl_SetObjResult(interp,
		Tcl_NewStringObj("legacy [clock scan] does not support -locale", -1));
	    Tcl_SetErrorCode(interp, "CLOCK", "flagWithLegacyFormat", NULL);
	    ret = TCL_ERROR;
	    goto done;
	}
	ret = ClockFreeScan(&yy, objv[1], &opts);
    }
    else {
	/* Use compiled version of Scan - */

	ret = ClockScan(&yy, objv[1], &opts);
................................................................................
    ret = ClockScanCommit(&yy, &opts);
    if (ret != TCL_OK) {
	goto done;
    }

    /* Apply validation rules, if expected */
    if ( (opts.flags & CLF_VALIDATE) ) {
	ret = ClockValidDate(&yy, &opts, opts.formatObj == NULL ? 2 : 3);
	if (ret != TCL_OK) {
	    goto done;
	}
    }

done:

    Tcl_UnsetObjRef(yy.date.tzName);