Skip to content

Commit

Permalink
Fixed malloc error -- Discovered on OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Thomas authored and Brandon Thomas committed Oct 11, 2015
1 parent 5699e81 commit 604e6d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CurlSSL.c
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 604e6d6

Please sign in to comment.