VirtualBox

Ignore:
Timestamp:
Jan 30, 2024 8:30:01 AM (10 months ago)
Author:
vboxsync
Message:

NetworkServices/NAT/rtmon_bsd.c: Plug socket descriptor leak, bugref:3409

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/rtmon_bsd.c

    r98103 r103112  
    111111#endif
    112112
     113    int rc = 1;
    113114    nsent = write(rtsock, &req, req.rtm.rtm_msglen);
    114115    if (nsent < 0) {
    115116        if (errno == ESRCH) {
    116117            /* there's no default route */
    117             return 0;
     118            rc = 0;
    118119        }
    119120        else {
    120121            DPRINTF0(("rtmon: failed to send RTM_GET\n"));
    121             return -1;
     122            rc = -1;
    122123        }
    123124    }
    124125
    125     return 1;
     126    close(rtsock);
     127    return rc;
    126128}
Note: See TracChangeset for help on using the changeset viewer.

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