|
From: Yoda-JM <yo...@us...> - 2011-02-24 10:34:20
|
Author: Lasse Kärkkäinen <tronic+ndrm at trn.iki.fi> Date: Mon Feb 7 02:43:57 2011 +0100 Fix delete vs. g_malloc mismatch. --- game/unicode.cc | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/game/unicode.cc b/game/unicode.cc index 31d2cf2..b0c4016 100644 --- a/game/unicode.cc +++ b/game/unicode.cc @@ -18,8 +18,9 @@ namespace { 0, &bytes_written, &gerror); if (gerror) throw std::runtime_error("Conversion error"); // Throw on error - - return std::string(boost::scoped_ptr<char>(buf).get(), bytes_written); + std::string ret(buf, bytes_written); + g_free(buf); + return ret; } } |