mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
e2b08f40b3
commit
3134c5eb62
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue