X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=ED2KLink.cpp;h=e1ec2ffba7070b5554dcb7cde130fe5695aa545b;hb=dc3a8cc1faaeb0b9fd1c65d88b04000ac57519eb;hp=1a8206651f7edc5ff258c1bafb431db6eef2bc3e;hpb=87c3276013058baf0a606510737ae03ae1c79727;p=ecparse.git diff --git a/ED2KLink.cpp b/ED2KLink.cpp index 1a82066..e1ec2ff 100644 --- a/ED2KLink.cpp +++ b/ED2KLink.cpp @@ -90,6 +90,7 @@ ED2KLink* ED2KLink::parseED2KLink(const char* buffer) { size = atol(sizeString); GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] parsed size “%s” into %d.\n", __FILE__, __LINE__, sizeString, size); + free(sizeString); for (hashIndex = 0; hashIndex < 16; hashIndex++) { char byteBuffer[3]; @@ -99,7 +100,9 @@ ED2KLink* ED2KLink::parseED2KLink(const char* buffer) { GlobalSettings::isVerbose() && fprintf(stderr, "[%s:%d] parsed ‘%c%c’ as %02x.\n", __FILE__, __LINE__, *(byteBuffer), *(byteBuffer + 1), hash[hashIndex]); } - return new ED2KLink(filename, size, hash); + ED2KLink* ed2kLink = new ED2KLink(filename, size, hash); + free(filename); + return ed2kLink; } const char* ED2KLink::getLink() {