From: Tobias Markus Date: Sat, 14 Feb 2015 16:41:05 +0000 (+0100) Subject: Fix for coverity #29377: Properly free memory of 's' X-Git-Url: https://git.octo.it/?a=commitdiff_plain;ds=sidebyside;h=3285879abc8874cf15e68e739ffa98721d39fff7;p=supertux.git Fix for coverity #29377: Properly free memory of 's' --- diff --git a/src/addon/md5.cpp b/src/addon/md5.cpp index 93dd1df76..904e6560a 100644 --- a/src/addon/md5.cpp +++ b/src/addon/md5.cpp @@ -162,7 +162,11 @@ std::string MD5::hex_digest() { s[32]='\0'; - return s; + // Create string from 's' + std::string s_str = std::string(s); + delete[] s; + + return s_str; } std::ostream& operator<<(std::ostream &stream, MD5 context) {