Index: generic/tclVar.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclVar.c,v
retrieving revision 1.188
diff -u -p -r1.188 tclVar.c
--- generic/tclVar.c	2 Feb 2010 00:29:32 -0000	1.188
+++ generic/tclVar.c	2 Feb 2010 16:08:19 -0000
@@ -3290,9 +3290,12 @@ Tcl_ArrayObjCmd(
 
 			if (protectedVarPtr) {
 			    VarHashRefCount(protectedVarPtr)--;
+			    CleanupVar(protectedVarPtr, arrayPtr);
 			}
 			return TCL_ERROR;
 		    }
+		} else {
+		    CleanupVar(varPtr2, arrayPtr);
 		}
 	    }
 	    break;
