Don't leave dangling temp file if connection is lost
authorJamie Cameron <jcameron@webmin.com>
Sat, 6 Nov 2010 18:52:10 +0000 (11:52 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sat, 6 Nov 2010 18:52:10 +0000 (11:52 -0700)
updown/fetch.cgi

index 960af11..8bccd25 100755 (executable)
@@ -50,11 +50,11 @@ if ($ENV{'PATH_INFO'}) {
                print "Content-size: $st[7]\n";
                print "Content-type: application/zip\n\n";
                open(FILE, $temp);
+               unlink($temp);
                while(<FILE>) {
                        print $_;
                        }
                close(FILE);
-               unlink($temp);
                }
        else {
                # Work out the type