Fixed a globally leaked buf in generate.js

Tip: Testing with something like http://visionmedia.github.com/mocha/ detects global leaks.