Fixed missing GC_PROTECTs within send_substring
This commit is contained in:
parent
fc88c1907a
commit
6aa549d288
|
@ -321,12 +321,12 @@ s48_value send_substring(s48_value scm_sockfd,
|
|||
int flags = s48_extract_fixnum (scm_flags);
|
||||
int start = s48_extract_fixnum (scm_start);
|
||||
int end = s48_extract_fixnum (scm_end);
|
||||
char* buf_part = s48_extract_string (buf) + start;
|
||||
|
||||
switch(s48_extract_fixnum (scm_family))
|
||||
{
|
||||
case 0: /* only with connected sockets */
|
||||
{
|
||||
char* buf_part = s48_extract_string (buf) + start;
|
||||
n = send(s, buf_part, end-start, flags);
|
||||
break;
|
||||
}
|
||||
|
@ -334,6 +334,7 @@ s48_value send_substring(s48_value scm_sockfd,
|
|||
{
|
||||
struct sockaddr_un name;
|
||||
int scheme_length=S48_STRING_LENGTH(scheme_name);
|
||||
char* buf_part = s48_extract_string (buf) + start;
|
||||
|
||||
memset(&name, 0, sizeof(name));
|
||||
|
||||
|
@ -353,8 +354,16 @@ s48_value send_substring(s48_value scm_sockfd,
|
|||
case AF_INET:
|
||||
{
|
||||
struct sockaddr_in name;
|
||||
u_long addr = htonl (s48_extract_unsigned_integer (S48_CAR (scheme_name)));
|
||||
u_short port = htons(s48_extract_fixnum (S48_CDR (scheme_name)));
|
||||
u_long addr;
|
||||
u_short port;
|
||||
char* buf_part;
|
||||
S48_DECLARE_GC_PROTECT(2);
|
||||
|
||||
S48_GC_PROTECT_2 (scheme_name,buf);
|
||||
|
||||
addr = htonl (s48_extract_unsigned_integer (S48_CAR (scheme_name)));
|
||||
port = htons (s48_extract_fixnum (S48_CDR (scheme_name)));
|
||||
buf_part = s48_extract_string (buf) + start;
|
||||
|
||||
memset(&name, 0, sizeof(name));
|
||||
|
||||
|
@ -372,7 +381,7 @@ s48_value send_substring(s48_value scm_sockfd,
|
|||
s48_raise_argument_type_error (s48_extract_fixnum (scm_family));
|
||||
/* error unknown address family */
|
||||
}
|
||||
|
||||
S48_GC_UNPROTECT();
|
||||
if (n >= 0)
|
||||
return s48_enter_fixnum (n);
|
||||
|
||||
|
|
Loading…
Reference in New Issue