Index: includes/content.token.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/includes/Attic/content.token.inc,v
retrieving revision 1.5.2.8
retrieving revision 1.5.2.10
diff -u -p -r1.5.2.8 -r1.5.2.10
--- includes/content.token.inc	5 Dec 2008 14:59:22 -0000	1.5.2.8
+++ includes/content.token.inc	4 Dec 2010 13:25:13 -0000	1.5.2.10
@@ -1,5 +1,5 @@
 <?php
-// $Id: content.token.inc,v 1.5.2.8 2008/12/05 14:59:22 yched Exp $
+// $Id: content.token.inc,v 1.5.2.10 2010/12/04 13:25:13 yched Exp $
 
 /**
  * @file
@@ -24,9 +24,12 @@ function token_content_build_modes() {
 function content_token_values($type, $object = NULL) {
   $tokens = array();
   if ($type == 'node') {
-    $node = $object;
     // Prevent against invalid 'nodes' built by broken 3rd party code.
-    if (isset($node->type)) {
+    if (isset($object->type)) {
+      // Let PHP free the $node object when we are done. Working directly on the
+      // incoming $object causes memory leak issues on long-running scripts such
+      // as migrations. See http://drupal.org/node/736440.
+      $node = clone $object;
       $type = content_types($node->type);
       $node->build_mode = 'token';
       $node->content = array();