diff options
author | dgp <dgp@users.sourceforge.net> | 2012-12-13 20:20:46 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2012-12-13 20:20:46 (GMT) |
commit | 4eaff43e124f523dca05591bc760fa9f32eb7672 (patch) | |
tree | 5e427fade1da0aae431f74090f943fc2b75ccc1a /generic/tclZlib.c | |
parent | a555b6e7aaf7b6d30b29e65984f3a96f0435e184 (diff) | |
download | tcl-4eaff43e124f523dca05591bc760fa9f32eb7672.zip tcl-4eaff43e124f523dca05591bc760fa9f32eb7672.tar.gz tcl-4eaff43e124f523dca05591bc760fa9f32eb7672.tar.bz2 |
TIP 400 suffered from the same segfaulting flaw as 3595576.
Segfaulting test and fix committed.
Diffstat (limited to 'generic/tclZlib.c')
-rw-r--r-- | generic/tclZlib.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 8fbe049..9c1176e 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -507,7 +507,7 @@ GenerateHeader( * ExtractHeader -- * * Take the values out of a gzip header and store them in a dictionary. - * SetValue is a helper function. + * SetValue is a helper macro. * * Results: * None. @@ -518,18 +518,8 @@ GenerateHeader( *---------------------------------------------------------------------- */ -static inline void -SetValue( - Tcl_Obj *dictObj, - const char *key, - Tcl_Obj *value) -{ - Tcl_Obj *keyObj = Tcl_NewStringObj(key, -1); - - Tcl_IncrRefCount(keyObj); - Tcl_DictObjPut(NULL, dictObj, keyObj, value); - TclDecrRefCount(keyObj); -} +#define SetValue(dictObj, key, value) \ + Tcl_DictObjPut(NULL, (dictObj), Tcl_NewStringObj((key), -1), (value)) static void ExtractHeader( @@ -2119,9 +2109,6 @@ ZlibCmd( } if (headerVarObj != NULL && Tcl_ObjSetVar2(interp, headerVarObj, NULL, headerDictObj, TCL_LEAVE_ERR_MSG) == NULL) { - if (headerDictObj) { - TclDecrRefCount(headerDictObj); - } return TCL_ERROR; } return TCL_OK; |