mirror of
https://github.com/curl/curl.git
synced 2026-08-25 06:33:32 +03:00
parent
cb307544ad
commit
1b8f4dba28
16 changed files with 22 additions and 32 deletions
|
|
@ -1017,7 +1017,7 @@ WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
|||
size_t realsize = size * nmemb;
|
||||
struct MemoryStruct *mem = (struct MemoryStruct *)data;
|
||||
|
||||
mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1);
|
||||
mem->memory = realloc(mem->memory, mem->size + realsize + 1);
|
||||
if(mem->memory) {
|
||||
memcpy(&(mem->memory[mem->size]), ptr, realsize);
|
||||
mem->size += realsize;
|
||||
|
|
|
|||
|
|
@ -99,9 +99,7 @@ static void curl_perform(int fd, short event, void *arg)
|
|||
|
||||
static struct curl_context *create_curl_context(curl_socket_t sockfd)
|
||||
{
|
||||
struct curl_context *context;
|
||||
|
||||
context = (struct curl_context *)malloc(sizeof(*context));
|
||||
struct curl_context *context = malloc(sizeof(*context));
|
||||
|
||||
context->sockfd = sockfd;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,9 +58,7 @@ struct curl_context {
|
|||
static struct curl_context *create_curl_context(curl_socket_t sockfd,
|
||||
struct datauv *uv)
|
||||
{
|
||||
struct curl_context *context;
|
||||
|
||||
context = (struct curl_context *)malloc(sizeof(*context));
|
||||
struct curl_context *context = malloc(sizeof(*context));
|
||||
|
||||
context->sockfd = sockfd;
|
||||
context->uv = uv;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue