From c260ec5c1673f9071b0c9c5407944ecb35bf5ff2 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 8 Oct 2013 13:22:32 -0700 Subject: 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 Signed-off-by: Dirk Hohndel --- gettextfromc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() -- cgit v1.2.3-70-g09d2