VirtualBox

Changeset 80403 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Aug 23, 2019 4:03:40 PM (5 years ago)
Author:
vboxsync
Message:

Serial/NamedPipe: don't leak the socket if connect(2) fails.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp

    r76553 r80403  
    10381038        /* Connect to the local socket. */
    10391039        if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) == -1)
     1040        {
     1041            close(s);
    10401042            return PDMDrvHlpVMSetError(pDrvIns, RTErrConvertFromErrno(errno), RT_SRC_POS,
    10411043                                       N_("NamedPipe#%d failed to connect to local socket %s"),
    10421044                                       pDrvIns->iInstance, pThis->pszLocation);
     1045        }
    10431046
    10441047        rc = RTSocketFromNative(&pThis->hSock, s);
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