Fixed two memory leaks.

This commit is contained in:
Philip Homburg 2006-02-16 14:13:36 +00:00
parent 30f7f852ba
commit df92754d67
3 changed files with 15 additions and 4 deletions

View file

@ -1340,7 +1340,12 @@ PRIVATE void arp_bufcheck()
for (i= 0, arp_port= arp_port_table; i<eth_conf_nr; i++, arp_port++)
{
for (pack= arp_port->ap_reqlist; pack;
for (pack= arp_port->ap_reclist; pack;
pack= pack->acc_ext_link)
{
bf_check_acc(pack);
}
for (pack= arp_port->ap_sendlist; pack;
pack= pack->acc_ext_link)
{
bf_check_acc(pack);

View file

@ -335,9 +335,6 @@ ioreq_t req;
return NW_OK;
}
acc= bf_memreq(sizeof(nwio_ethstat_t));
compare (bf_bufsize(acc), ==, sizeof(*ethstat));
if (!(eth_port->etp_flags & EPF_GOT_ADDR))
{
printf(
@ -349,6 +346,9 @@ ioreq_t req;
return NW_SUSPEND;
}
acc= bf_memreq(sizeof(nwio_ethstat_t));
compare (bf_bufsize(acc), ==, sizeof(*ethstat));
ethstat= (nwio_ethstat_t *)ptr2acc_data(acc);
ethstat->nwes_addr= eth_port->etp_ethaddr;

View file

@ -2269,12 +2269,14 @@ tcp_fd_t *tcp_fd;
sizeof(*cookiep), TRUE);
if (!data)
return EFAULT;
data= bf_packIffLess(data, sizeof(*cookiep));
cookiep= (tcp_cookie_t *)ptr2acc_data(data);
dst_nr= cookiep->tc_ref;
if (dst_nr < 0 || dst_nr >= TCP_FD_NR)
{
bf_afree(data); data= NULL;
printf("tcp_acceptto: bad fd %d\n", dst_nr);
tcp_reply_ioctl(tcp_fd, EINVAL);
return NW_OK;
@ -2285,6 +2287,7 @@ tcp_fd_t *tcp_fd;
dst_fd->tf_conn != NULL ||
!(dst_fd->tf_flags & TFF_COOKIE))
{
bf_afree(data); data= NULL;
printf("tcp_acceptto: bad flags 0x%x or conn %p for fd %d\n",
dst_fd->tf_flags, dst_fd->tf_conn, dst_nr);
tcp_reply_ioctl(tcp_fd, EINVAL);
@ -2292,10 +2295,13 @@ tcp_fd_t *tcp_fd;
}
if (memcmp(cookiep, &dst_fd->tf_cookie, sizeof(*cookiep)) != 0)
{
bf_afree(data); data= NULL;
printf("tcp_acceptto: bad cookie\n");
return NW_OK;
}
bf_afree(data); data= NULL;
/* Move connection */
tcp_fd->tf_listenq[i]= NULL;
tcp_conn->tc_fd= dst_fd;