get rid of malloc for offlen_t... this can probably be moved to full RAII