aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-13 15:16:10 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-13 15:16:10 +0000
commit594cb8507bef298a5955067ade353128f2c2b6da (patch)
treeafec4e5381a33f72c0dc63db6c7c9da0fb93b98d
parent78aba6e4cd4283149c5092ced0a075e6807c9015 (diff)
deal with input arguments as NULL
-rw-r--r--lib/easy.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c
index c162ef531..85a8abf12 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -307,6 +307,9 @@ CURLcode curl_easy_setopt(CURL *curl, CURLoption tag, ...)
struct SessionHandle *data = curl;
CURLcode ret=CURLE_FAILED_INIT;
+ if(!curl)
+ return CURLE_BAD_FUNCTION_ARGUMENT;
+
va_start(arg, tag);
/* PORTING NOTE:
@@ -348,6 +351,9 @@ CURLcode curl_easy_perform(CURL *curl)
{
struct SessionHandle *data = (struct SessionHandle *)curl;
+ if(!data)
+ return CURLE_BAD_FUNCTION_ARGUMENT;
+
if ( ! (data->share && data->share->hostcache) ) {
if (Curl_global_host_cache_use(data) &&
@@ -379,6 +385,10 @@ CURLcode curl_easy_perform(CURL *curl)
void curl_easy_cleanup(CURL *curl)
{
struct SessionHandle *data = (struct SessionHandle *)curl;
+
+ if(!data)
+ return;
+
if ( ! (data->share && data->share->hostcache) ) {
if ( !Curl_global_host_cache_use(data)) {
Curl_hash_destroy(data->hostcache);