summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-08 13:22:32 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-08 13:26:01 -0700
commitc260ec5c1673f9071b0c9c5407944ecb35bf5ff2 (patch)
treee18767928002e6fe8f5d577162b982a0c51b3d25
parent292b9aed481f5d1b98494bada5e8bf0551323771 (diff)
downloadsubsurface-c260ec5c1673f9071b0c9c5407944ecb35bf5ff2.tar.gz
Make a copy of the translated text
Otherwise the translation will get freed (and often reused) before it makes it to the screen. The problem with this is that it leaks memory for every translation. Reported-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--gettextfromc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/gettextfromc.cpp b/gettextfromc.cpp
index 4976d70f8..fe6263a4b 100644
--- a/gettextfromc.cpp
+++ b/gettextfromc.cpp
@@ -4,7 +4,7 @@
char *gettextFromC::gettext(const char *text)
{
- return tr(text).toLocal8Bit().data();
+ return strdup(tr(text).toLocal8Bit().data());
}
gettextFromC* gettextFromC::instance()