From: VMware, Inc <> Date: Wed, 18 Sep 2013 03:33:46 +0000 (-0700) Subject: Fix stringxx to call Unicode_Free() instead of free() X-Git-Tag: 2013.09.16-1328054~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b07756ed5974aaed6dec4fc14ae52fe031ae00d;p=thirdparty%2Fopen-vm-tools.git Fix stringxx to call Unicode_Free() instead of free() Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/include/unicodeBase.h b/open-vm-tools/lib/include/unicodeBase.h index a8c8d1f9b..473cc02cc 100644 --- a/open-vm-tools/lib/include/unicodeBase.h +++ b/open-vm-tools/lib/include/unicodeBase.h @@ -172,7 +172,7 @@ Unicode_AllocWithUTF16(const utf16_t *utf16String) // IN Unicode Unicode_Duplicate(ConstUnicode str); -void Unicode_Free(Unicode str); +void Unicode_Free(void *str); Unicode *Unicode_AllocList(char **srcList, ssize_t length, diff --git a/open-vm-tools/lib/unicode/unicodeSimpleBase.c b/open-vm-tools/lib/unicode/unicodeSimpleBase.c index 8d7706037..c0b4d0c58 100644 --- a/open-vm-tools/lib/unicode/unicodeSimpleBase.c +++ b/open-vm-tools/lib/unicode/unicodeSimpleBase.c @@ -227,7 +227,7 @@ Unicode_Duplicate(ConstUnicode str) // IN */ void -Unicode_Free(Unicode str) // IN +Unicode_Free(void *str) // IN { free(str); } diff --git a/open-vm-tools/services/plugins/dndcp/stringxx/ubstr_t.hh b/open-vm-tools/services/plugins/dndcp/stringxx/ubstr_t.hh index 955d1b6ee..f477d58d0 100644 --- a/open-vm-tools/services/plugins/dndcp/stringxx/ubstr_t.hh +++ b/open-vm-tools/services/plugins/dndcp/stringxx/ubstr_t.hh @@ -133,7 +133,7 @@ private: // Takes ownership of the input string. void Set(char *utf8String) // IN/OUT: May be NULL. { - free(mUTF8String); + Unicode_Free(mUTF8String); mUTF8String = utf8String; } @@ -146,7 +146,7 @@ private: // Only destructible via unreference(). ~UTF8Data() { - free(mUTF8String); + Unicode_Free(mUTF8String); } char *mUTF8String; @@ -256,9 +256,9 @@ ubstr_t::ubstr_t(const char *s) // IN: A UTF-8-encoded string. utf16_t *utf16Str = Unicode_GetAllocUTF16(s); try { mBstr = utf16Str; - free(utf16Str); + Unicode_Free(utf16Str); } catch (...) { - free(utf16Str); + Unicode_Free(utf16Str); throw; } } @@ -843,7 +843,7 @@ ubstr_t::GetUTF8Cache() mUTF8->Set(utf8Str); } } catch (...) { - free(utf8Str); + Unicode_Free(utf8Str); throw; }