Fix memory leak in build_source

(Issue #3.)
Merge pull request #4 from anchor/fix-memleak

Fix memory leak in build_source