Replace structure member before decreffing.
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 3da0258..4069ea2 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -662,6 +662,7 @@
 {
 	PyObject *item;
 	PyObject *it;
+	PyObject *tmp;
 
 	while (1) {
 		item = PyIter_Next(lz->it);
@@ -681,9 +682,10 @@
 		it = PyObject_GetIter(lz->saved);
 		if (it == NULL)
 			return NULL;
-		Py_DECREF(lz->it);
+		tmp = lz->it;
 		lz->it = it;
 		lz->firstpass = 1;
+		Py_DECREF(tmp);
 	}
 }