summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2001-04-28 21:44:44 +0000
committerSterling Hughes <sterling@php.net>2001-04-28 21:44:44 +0000
commit425c71443565f2ec62808715e0a5baf561725ab9 (patch)
treedcc88533ff43d6661a5d712e85b4a26dfc09dff3
parentd53ab0ae48f444c6f4bafc7d8a585531bf7b9004 (diff)
downloadphp-git-425c71443565f2ec62808715e0a5baf561725ab9.tar.gz
# Actually fix the bug this time (I fixed another bug last time :)
-rw-r--r--ext/curl/curl.c8
-rw-r--r--ext/curl/php_curl.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/ext/curl/curl.c b/ext/curl/curl.c
index 6fac748527..ad54b899c1 100644
--- a/ext/curl/curl.c
+++ b/ext/curl/curl.c
@@ -580,9 +580,10 @@ PHP_FUNCTION(curl_exec)
php_error(E_WARNING, "Cannot initialize temporary file to save output from %s()", get_active_function_name());
RETURN_FALSE;
}
-
- curl_easy_setopt(curl_handle->cp, CURLOPT_FILE, fp);
-
+ curl_handle->tmp_fp = fp;
+
+ curl_easy_setopt(curl_handle->cp, CURLOPT_FILE, fp);
+
is_temp_file = 1;
} else if (curl_handle->return_transfer &&
@@ -803,6 +804,7 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc)
{
php_curl *curl_handle = (php_curl *)rsrc->ptr;
curl_easy_cleanup(curl_handle->cp);
+ if (curl_handle->tmp_fp) fclose(curl_handle->tmp_fp);
zend_llist_clean(&curl_handle->to_free);
efree(curl_handle);
}
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h
index 838cb1d382..58ee10aa2b 100644
--- a/ext/curl/php_curl.h
+++ b/ext/curl/php_curl.h
@@ -55,6 +55,7 @@ typedef struct {
int php_stdout;
int cerrno;
char error[CURL_ERROR_SIZE+1];
+ FILE *tmp_fp;
CURL *cp;
zend_llist to_free;
} php_curl;