Set s->d1 to NULL after freeing it.