Remove temporary files at the end
authorJoey Schulze <joey@infodrom.org>
Fri, 14 Dec 2007 15:39:50 +0000 (15:39 +0000)
committerJoey Schulze <joey@infodrom.org>
Fri, 14 Dec 2007 15:39:50 +0000 (15:39 +0000)
cgi.c

diff --git a/cgi.c b/cgi.c
index f1fa9a0..2aa5292 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -270,7 +270,6 @@ s_cgi *cgiReadMultipart (char *boundary)
                    continue;
                fname = strndup (cp, xp-cp);
                cgiDebugOutput (2, "Found filename %s", fname);
-               /* TODO: filename */
            }
        } else if (!strncasecmp (line, "Content-Type: ", 14)) {
            if (!type) {
@@ -800,8 +799,10 @@ void cgiFree (s_cgi *parms)
                free (parms->files[i]->type);
            if (parms->files[i]->filename)
                free (parms->files[i]->filename);
-           if (parms->files[i]->tmpfile)
+           if (parms->files[i]->tmpfile) {
+               unlink (parms->files[i]->tmpfile);
                free (parms->files[i]->tmpfile);
+           }
            free (parms->files[i]);
        }
        free (parms->files);