Add a missing but inconsequential free(3).

Spotted by:	Coverity
Add a testcase for #1406 to -trunk, which is not affected.