cURL / Mailing Lists / curl-library / Single Mail


Small LibCurl example is generating _CrtIsValidHeapPointer(pUserData)

From: Brett <>
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();
             curl_easy_setopt(curl, CURLOPT_URL,
             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));
                 Msg("Test was Successful!\n");

             /* always cleanup */

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 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
List admin:
Received on 2010-11-29