fixed memory leak

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/timereg@362 edab9b15-3c32-4f9a-a569-739a535b425d
added new test file

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/timereg@363 edab9b15-3c32-4f9a-a569-739a535b425d