some mismatched malloc/free usage with osd_* functions (nw)