From 604e6d6397e35bc804940866903c5c2d77fb2811 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 11 Oct 2015 11:05:35 -0400 Subject: [PATCH] Fixed malloc error -- Discovered on OSX --- CurlSSL.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CurlSSL.c b/CurlSSL.c index 1f888c6..7328838 100644 --- a/CurlSSL.c +++ b/CurlSSL.c @@ -586,7 +586,7 @@ bool Curl_SMTP(CurlSock* curl_info, const char* url, const char* user, const cha Curl_SetUpload(curl_info, true); curl_easy_setopt(curl_info->curl_handle, CURLOPT_MAIL_FROM, user); - char* data[10000] = {0}; + char** data = malloc(10000); data_struct->memory = (char*)data; char from_buffer[512] = {0}; @@ -645,7 +645,9 @@ bool Curl_SMTP(CurlSock* curl_info, const char* url, const char* user, const cha CURLcode res = curl_easy_perform(curl_info->curl_handle); curl_slist_free_all(recipients); - for (; i < count; ++i) free(data[i]); + for (; i < count; ++i) + free(data[i]); + Curl_FreeMemoryStruct((CurlMemoryStruct **)&curl_info->params); curl_info->params = oldparams;