]> granicus.if.org Git - php/commitdiff
fix bug #15150, thanks to daniel at haxx.se for the fix
authorSterling Hughes <sterling@php.net>
Wed, 3 Apr 2002 23:59:36 +0000 (23:59 +0000)
committerSterling Hughes <sterling@php.net>
Wed, 3 Apr 2002 23:59:36 +0000 (23:59 +0000)
ext/curl/curl.c

index 9406138fb9fb084e5c9af4dc866d640302fc2449..17fc018f2ee9f7d75bca7da946c329dc651c8fa0 100644 (file)
@@ -797,8 +797,8 @@ PHP_FUNCTION(curl_setopt)
                                }
                        }
 
+                       SAVE_CURL_ERROR(ch, error);
                        if (error != CURLE_OK) {
-                               SAVE_CURL_ERROR(ch, error);
                                RETURN_FALSE;
                        }
 
@@ -856,9 +856,9 @@ PHP_FUNCTION(curl_setopt)
                break;
        }
        }
-       
+
+       SAVE_CURL_ERROR(ch, error);
        if (error != CURLE_OK) {
-               SAVE_CURL_ERROR(ch, error);
                RETURN_FALSE;
        } else {
                RETURN_TRUE;
@@ -881,10 +881,10 @@ PHP_FUNCTION(curl_exec)
        ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
 
        error = curl_easy_perform(ch->cp);
+       SAVE_CURL_ERROR(ch, error);
        if (error != CURLE_OK) {
                if (ch->handlers->write->buf.len > 0)
                        smart_str_free(&ch->handlers->write->buf);
-               SAVE_CURL_ERROR(ch, error);
                RETURN_FALSE;
        }