r939: fixed a memory leak (issue #35)