From c9904354f963a54cce9cce3661d3e3ee965f8e05 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu <tsuda.kageyu@gmail.com> Date: Tue, 11 Jun 2013 12:51:26 +0900 Subject: [PATCH] Prevent string conversion buffer to stay in memory --- bindings/c/tag_c.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/c/tag_c.cpp b/bindings/c/tag_c.cpp index 816b9578..007ab823 100644 --- a/bindings/c/tag_c.cpp +++ b/bindings/c/tag_c.cpp @@ -49,15 +49,15 @@ namespace inline char *stringToCharArray(const String &s) { - const char *c = s.toCString(unicodeStrings); + const std::string str = s.to8Bit(unicodeStrings); #ifdef HAVE_ISO_STRDUP - return ::_strdup(c); + return ::_strdup(str.c_str()); #else - return ::strdup(c); + return ::strdup(str.c_str()); #endif }