implemented os_free - without subfunctions