Fixed buffer size (tempfile[256]) could overflow if a long pathname was
passed. strdup() was used for the filename itself so malloc the tempfile name as well!
Authored by: sms00 2004-12-16
Parent: [r2520]
Child: [r2522]