cURL / Mailing Lists / curl-library / Single Mail

curl-library

Small LibCurl example is generating _CrtIsValidHeapPointer(pUserData)

From: Brett <brett_at_brutalservers.net>
Date: Mon, 29 Nov 2010 02:20:53 -0500

I was told earlier to use a basic HTTPS sample to verify that my
LibCurl/OpenSSL build was working properly (could have sworn I already
posted this but I can't find it). I am getting the following popup when
my application runs...

Debug Assertion Failed!
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c

Expression: _CrtIsValidHeapPointer(pUserData)

This is resulting from this code block...

         CURL *curl;
         CURLcode res;

         curl = curl_easy_init();
         if(curl)
         {
             curl_easy_setopt(curl, CURLOPT_URL,
"https://forums.alliedmods.net");
             curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); //
Don't bother verifying a certificate
             curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); //
Don't bother verifying a certificate
             res = curl_easy_perform(curl);

             if(res != CURLE_OK)
             {
                 Msg("Test Error: %s\n", curl_easy_strerror(res));
             }
             else
             {
                 Msg("Test was Successful!\n");
             }

             /* always cleanup */
             curl_easy_cleanup(curl);
         }

Which is about as simple as it gets. I have tried both my own builds
(LibCurl and OpenSSL built as lib files, then statically linked) as well
as the php.net build which obviously works fine (LibCurl built as a lib,
OpenSSL dynamically linked) but both are generating this error which
crashes the application. It is happening when curl_easy_perform(curl) is
called.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-29