VirtualBox

Ignore:
Timestamp:
Jun 14, 2011 9:32:05 AM (14 years ago)
Author:
vboxsync
Message:

usb/win: close handle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp

    r37065 r37431  
    809809{
    810810    LPSTR lpszDevName = (LPSTR)RTMemAllocZ(strlen(lpszName) + sizeof("\\\\.\\"));
     811    HANDLE hDev = INVALID_HANDLE_VALUE;
    811812    Assert(lpszDevName);
    812813    if (!lpszDevName)
     
    822823    {
    823824        DWORD cbReturned = 0;
    824         HANDLE hDev = CreateFile(lpszDevName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
     825        hDev = CreateFile(lpszDevName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
    825826        if (hDev == INVALID_HANDLE_VALUE)
    826827        {
     
    845846        }
    846847    } while (0);
     848
     849    if (hDev != INVALID_HANDLE_VALUE)
     850        CloseHandle(hDev);
     851
    847852    RTMemFree(lpszDevName);
    848853
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