1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

win32.c: bail out if no memory

* win32/win32.c (rb_w32_write_console): bail out when buffer
  allocation failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-10-10 06:33:38 +00:00
parent 09b02349c2
commit d63f9e933c

View file

@ -6534,6 +6534,7 @@ rb_w32_write_console(uintptr_t strarg, int fd)
/* assume UTF-8 */
case ENCINDEX_UTF_8:
ptr = wbuffer = mbstr_to_wstr(CP_UTF8, RSTRING_PTR(str), RSTRING_LEN(str), &len);
if (!ptr) return -1L;
break;
case ENCINDEX_UTF_16LE:
ptr = (const WCHAR *)RSTRING_PTR(str);