Index: CHANGELOG.txt =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/cck/Attic/CHANGELOG.txt,v retrieving revision 1.1.6.400 diff -u -p -r1.1.6.400 CHANGELOG.txt --- CHANGELOG.txt 10 Nov 2010 17:57:05 -0000 1.1.6.400 +++ CHANGELOG.txt 3 Dec 2010 16:26:46 -0000 @@ -5,6 +5,7 @@ CCK 6.x-2.x - #863226 by KarenS: make sure we have a function that will return inactive instances when other instances of the same field are still active. - #887742 by yched: fix notices in _content_get_formatter() in some Views +- #736440 by yched, dhthwy: fix memory leaks on long running migration scripts (e.g. migrate.module) CCK 6.x-2.8 =========== 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 diff -u -p -r1.5.2.8 content.token.inc --- includes/content.token.inc 5 Dec 2008 14:59:22 -0000 1.5.2.8 +++ includes/content.token.inc 3 Dec 2010 16:26:46 -0000 @@ -24,7 +24,10 @@ function token_content_build_modes() { function content_token_values($type, $object = NULL) { $tokens = array(); if ($type == 'node') { - $node = $object; + // 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; // Prevent against invalid 'nodes' built by broken 3rd party code. if (isset($node->type)) { $type = content_types($node->type);