reserve enough memory
[ecparse.git] / ED2KLink.cpp
index 5f33ce8..74a38c9 100644 (file)
@@ -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);