Remove an unused variable and fix a memory leak in sctp_connectx().
Approved by: re (gjb) MFC after: 3 days
This commit is contained in:
parent
d83d73618f
commit
10e6d832d5
@ -101,10 +101,10 @@ sctp_connectx(int sd, const struct sockaddr *addrs, int addrcnt,
|
||||
sctp_assoc_t * id)
|
||||
{
|
||||
char *buf;
|
||||
int i, ret, cnt, *aa;
|
||||
int i, ret, *aa;
|
||||
char *cpto;
|
||||
const struct sockaddr *at;
|
||||
size_t len = sizeof(int);
|
||||
size_t len;
|
||||
|
||||
/* validate the address count and list */
|
||||
if ((addrs == NULL) || (addrcnt <= 0)) {
|
||||
@ -115,8 +115,8 @@ sctp_connectx(int sd, const struct sockaddr *addrs, int addrcnt,
|
||||
errno = E2BIG;
|
||||
return (-1);
|
||||
}
|
||||
len = sizeof(int);
|
||||
at = addrs;
|
||||
cnt = 0;
|
||||
cpto = buf + sizeof(int);
|
||||
/* validate all the addresses and get the size */
|
||||
for (i = 0; i < addrcnt; i++) {
|
||||
@ -161,6 +161,7 @@ sctp_connectx(int sd, const struct sockaddr *addrs, int addrcnt,
|
||||
if ((ret == 0) && (id != NULL)) {
|
||||
*id = *(sctp_assoc_t *) buf;
|
||||
}
|
||||
free(buf);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user