diff options
author | sebres <sebres@users.sourceforge.net> | 2019-01-10 13:55:20 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2019-01-10 13:55:20 (GMT) |
commit | 2aee61ea3055c9d7212040a402680c89b8df2a9e (patch) | |
tree | 603079c9b24e29d40e3ca5634b416dc0cb563752 | |
parent | a4600a6847c0bd3f41f69d0446138d37063ef25b (diff) | |
download | tcl-2aee61ea3055c9d7212040a402680c89b8df2a9e.zip tcl-2aee61ea3055c9d7212040a402680c89b8df2a9e.tar.gz tcl-2aee61ea3055c9d7212040a402680c89b8df2a9e.tar.bz2 |
avoid possible leaking on tzName-object in error case (most impossible resp. rarely, but nevertheless better don't return directly).
-rw-r--r-- | generic/tclClock.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c index e1c70e9..4389e16 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -3634,7 +3634,8 @@ ClockScanObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj("legacy [clock scan] does not support -locale", -1)); Tcl_SetErrorCode(interp, "CLOCK", "flagWithLegacyFormat", NULL); - return TCL_ERROR; + ret = TCL_ERROR; + goto done; } ret = ClockFreeScan(&yy, objv[1], &opts); } @@ -3657,9 +3658,9 @@ ClockScanObjCmd( /* Apply validation rules, if expected */ if ( (opts.flags & CLF_VALIDATE) ) { - if (ClockValidDate(&yy, &opts, - opts.formatObj == NULL ? 2 : 3) != TCL_OK) { - return TCL_ERROR; + ret = ClockValidDate(&yy, &opts, opts.formatObj == NULL ? 2 : 3); + if (ret != TCL_OK) { + goto done; } } |