Change freeing method because the allocation function was changed in r5532