Check pkg_malloc allocation