This should be free only after being passed back to R, otherwise we get reads in freed memory