From 55b916972339f95b2cd7c13c178e43c12f71c147 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Sun, 12 Feb 2023 01:53:22 +0100 Subject: don't preallocate memory --- src/net.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/net.c b/src/net.c index ef661e2..7c76d4c 100644 --- a/src/net.c +++ b/src/net.c @@ -48,13 +48,7 @@ struct MemoryStruct* downloadToRam(const char* url) if (chunk) { - chunk->memory = malloc(1); - if (!chunk->memory) - { - free(chunk); - return NULL; - } - chunk->memory[0] = 0; + chunk->memory = NULL; chunk->size = 0; curl_handle = curl_easy_init(); -- cgit v1.2.3