From: David ‘Bombe’ Roden Date: Sat, 5 Jul 2008 20:49:25 +0000 (+0200) Subject: reserve enough memory X-Git-Tag: 0.1~21 X-Git-Url: https://git.pterodactylus.net/?p=ecparse.git;a=commitdiff_plain;h=a0eb955ae6aa166e2c54bcbdd2521d75264fd3ad reserve enough memory --- diff --git a/ED2KLink.cpp b/ED2KLink.cpp index 5f33ce8..74a38c9 100644 --- a/ED2KLink.cpp +++ b/ED2KLink.cpp @@ -18,7 +18,7 @@ static int getDigits(size_t number) { } ED2KLink::ED2KLink(const char* filename, const size_t size, const void* hash) { - this->filename = (char*) malloc(strlen(filename)); + this->filename = (char*) malloc(strlen(filename) + 1); this->hash = malloc(16); strcpy(this->filename, filename);