From: Stanislav Malyshev Date: Mon, 30 Oct 2000 15:30:27 +0000 (+0000) Subject: Remove empty temp file on failed upload X-Git-Tag: php-4.0.4RC3~436 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f7a3b3b1172f7c6498c935fb2d9c541f2054bd7;p=php Remove empty temp file on failed upload --- diff --git a/main/rfc1867.c b/main/rfc1867.c index 4ec8d4653e..8c84c80010 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -372,7 +372,10 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S fclose(fp); add_protected_variable(namebuf PLS_CC); if (!upload_successful) { - efree(temp_filename); + if(temp_filename) { + unlink(temp_filename); + efree(temp_filename); + } temp_filename = "none"; } else { zend_hash_add(SG(rfc1867_uploaded_files), temp_filename, strlen(temp_filename)+1, &temp_filename, sizeof(char *), NULL);