From 3134c5eb62155efbab3dd415ecfd22515ed2ddd0 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 23 Aug 2013 08:17:47 +0000 Subject: [PATCH] win32ole.c: no copy string * ext/win32ole/win32ole.c (foletypelib_name, foletypelib_path): WC2VSTR() returns a string in cWIN32OLE_enc, no need to copy another string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/win32ole/win32ole.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 88595a4b3f..ed5d9141c4 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -5281,7 +5281,7 @@ foletypelib_name(VALUE self) ole_raise(hr, eWIN32OLERuntimeError, "failed to get name from ITypeLib"); } name = WC2VSTR(bstr); - return rb_enc_str_new(StringValuePtr(name), strlen(StringValuePtr(name)), cWIN32OLE_enc); + return name; } /* @@ -5436,7 +5436,7 @@ foletypelib_path(VALUE self) pTypeLib->lpVtbl->ReleaseTLibAttr(pTypeLib, pTLibAttr); path = WC2VSTR(bstr); - return rb_enc_str_new(StringValuePtr(path), strlen(StringValuePtr(path)), cWIN32OLE_enc); + return path; } /*