Fix memory allocation issues in ods-reader