pad: Fix memory leak in the unit test