Revision: 6330 Author: ek.kato Date: Tue Apr 20 01:46:51 2010 Log: * uim/socket.c (c_getaddrinfo) : Return #f if fails to avoid crash. * scm/socket.scm (call-with-getaddrinfo) : Follow the change.
http://code.google.com/p/uim/source/detail?r=6330 Modified: /trunk/scm/socket.scm /trunk/uim/socket.c ======================================= --- /trunk/scm/socket.scm Sun Apr 4 20:35:54 2010 +++ /trunk/scm/socket.scm Tue Apr 20 01:46:51 2010 @@ -65,8 +65,8 @@ (define (call-with-getaddrinfo hostname servname hints thunk) (let* ((res (getaddrinfo hostname servname hints)) - (ret (thunk res))) - (if (not (null? res)) + (ret (if res (thunk res) '()))) + (if res (freeaddrinfo (car res))) ret)) ======================================= --- /trunk/uim/socket.c Sun Apr 4 20:35:54 2010 +++ /trunk/uim/socket.c Tue Apr 20 01:46:51 2010 @@ -252,6 +252,8 @@ if (error) { const char *errstr = gai_strerror(error); uim_notify_fatal("getaddrinfo: %s", errstr); + free(servname); + return uim_scm_f(); } free(servname); -- Subscription settings: http://groups.google.com/group/uim-commit/subscribe?hl=en
