VirtualBox

Changeset 28510 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Apr 20, 2010 10:25:22 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60309
Message:

refined r60215

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/sbuf.c

    r28449 r28510  
    4343{
    4444    /*
    45      * vvl: This assert to catch double frees. tcp_close filter out
    46      * listening sockets which pass NULLs here.   
     45     * Catch double frees. Actually tcp_close() already filters out listening sockets
     46     * passing NULL.
    4747     */
    4848    Assert((sb->sb_data));
    49     RTMemFree(sb->sb_data);
    50     /** @todo bird: I'm seeing double frees here sometimes.  This NULL'ing is just a
    51        workaround for that, it doesn't actually fix anything.  */
    52     sb->sb_data = NULL;
     49
     50    /*
     51     * Don't call RTMemFree() for an already freed buffer, the EFence could complain
     52     */
     53    if (sb->sb_data)
     54    {
     55        RTMemFree(sb->sb_data);
     56        sb->sb_data = NULL;
     57    }
    5358}
    5459
  • trunk/src/VBox/Devices/Network/slirp/tcp_subr.c

    r28482 r28510  
    312312        tcp_last_so = &tcb;
    313313    closesocket(so->s);
    314     /* (vvl) opening listening socket we do not reserve sbufs for it */
    315     if ((so->so_state & SS_FACCEPTCONN) == 0)
     314    /* Avoid double free if the socket is listening and therefore doesn't have
     315     * any sbufs reserved. */
     316    if (!(so->so_state & SS_FACCEPTCONN))
    316317    {
    317318        sbfree(&so->so_rcv);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette