release the memory allocated

free(ofs) added to release the memory allocated
Merge pull request #1 from beatrixvlee/master

release the memory allocated