release the memory allocated

free(ofs) added to release the memory allocated