free() filename before throwing the pointer away

avoids a memory-leak pointed out by @crosser