diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-18 14:13:07 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-18 14:13:07 +0000 |
| commit | a0d73566ce70b720c03ca8aaaa0f6128079b518d (patch) | |
| tree | 68a1cb4d12c644caa9f5ffe92e1d0387ef199cf4 | |
| parent | f5f7549433a98912b51a3d958425d57756691ec5 (diff) | |
| download | ruby-a0d73566ce70b720c03ca8aaaa0f6128079b518d.tar.gz ruby-a0d73566ce70b720c03ca8aaaa0f6128079b518d.tar.xz ruby-a0d73566ce70b720c03ca8aaaa0f6128079b518d.zip | |
* win32/win32.c (open_ifs_socket): should not use plain malloc.
* win32/win32.c (rb_w32_opendir): should not use plain realloc.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | win32/win32.c | 6 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Tue Jul 18 23:10:43 2006 NAKAMURA Usaku <usa@ruby-lang.org> + + * win32/win32.c (open_ifs_socket): should not use plain malloc. + + * win32/win32.c (rb_w32_opendir): should not use plain realloc. + Tue Jul 18 16:52:29 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * eval.c (yield_under_i): argument should be passed in avalue diff --git a/win32/win32.c b/win32/win32.c index b780da07f..01378ffe2 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1462,7 +1462,7 @@ rb_w32_opendir(const char *filename) // new name and it's null terminator // - #define Renew(x, y, z) (x = (z *)realloc(x, y)) + #define Renew(x, y, z) (x = (z *)xrealloc(x, y)) Renew (p->start, idx+len+1, char); if (p->start == NULL) { @@ -2486,6 +2486,10 @@ open_ifs_socket(int af, int type, int protocol) int protocols_available = 0; proto_buffers = (WSAPROTOCOL_INFO *)malloc(proto_buffers_len); + if (!proto_buffers) { + WSASetLastError(WSA_NOT_ENOUGH_MEMORY); + return INVALID_SOCKET; + } protocols_available = WSAEnumProtocols(NULL, proto_buffers, &proto_buffers_len); |
