Minor update to the previous patch, it should obviously free the sv before setting the pointer to it to null.