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 | 8890130ab8712a4f466800f5680b617525d9feba (patch) | |
tree | 5e427fade1da0aae431f74090f943fc2b75ccc1a /generic/tclZlib.c | |
parent | 0ccb6618bd81f303878181effc620404a14515d8 (diff) | |
download | tcl-8890130ab8712a4f466800f5680b617525d9feba.zip tcl-8890130ab8712a4f466800f5680b617525d9feba.tar.gz tcl-8890130ab8712a4f466800f5680b617525d9feba.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; |