Browse Source

Understand your data structures!

Piotr Czajkowski 5 years ago
parent
commit
99359d59a5
1 changed files with 1 additions and 6 deletions
  1. 1 6
      curl.c

+ 1 - 6
curl.c

@@ -64,16 +64,11 @@ char *getData(char *url) {
 				curl_easy_strerror(res));
 	}
 
-	char *data = malloc(chunk.size);
-	memcpy(data, chunk.memory, chunk.size);  
-
 	/* cleanup curl stuff */ 
 	curl_easy_cleanup(curl_handle);
 
-	free(chunk.memory);
-
 	/* we're done with libcurl, so clean it up */ 
 	curl_global_cleanup();
 
-	return data;
+	return chunk.memory;
 }