pac: Fix wrong memory allocation check