VirtualBox

Ignore:
Timestamp:
Feb 22, 2019 6:27:43 PM (6 years ago)
Author:
vboxsync
Message:

Main/src-server/win/NetIf-win.cpp: make compiler happy but still fix the leak

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/win/NetIf-win.cpp

    r77436 r77437  
    235235struct StaticIpV6Config
    236236{
    237     Utf8Str        IPV6Address;
     237    char *         IPV6Address;
    238238    ULONG          IPV6NetMaskLength;
    239239};
     
    243243public:
    244244    NetworkInterfaceHelperClientData(){};
    245     ~NetworkInterfaceHelperClientData(){};
     245    ~NetworkInterfaceHelperClientData()
     246    {
     247        if (msgCode == SVCHlpMsg::EnableStaticIpConfigV6 && u.StaticIPV6.IPV6Address)
     248        {
     249            RTStrFree(u.StaticIPV6.IPV6Address);
     250            u.StaticIPV6.IPV6Address = NULL;
     251        }
     252    };
    246253
    247254    SVCHlpMsg::Code msgCode;
     
    536543            vrc = aClient->write(d->guid);
    537544            if (RT_FAILURE(vrc)) break;
    538             vrc = aClient->write(Utf8Str(d->u.StaticIPV6.IPV6Address));
     545            vrc = aClient->write(d->u.StaticIPV6.IPV6Address);
    539546            if (RT_FAILURE(vrc)) break;
    540547            vrc = aClient->write(d->u.StaticIPV6.IPV6NetMaskLength);
     
    13201327                    d->guid = guid;
    13211328                    d->iface = pIf;
    1322                     d->u.StaticIPV6.IPV6Address = aIPV6Address;
     1329                    d->u.StaticIPV6.IPV6Address = RTStrDup(aIPV6Address);
    13231330                    d->u.StaticIPV6.IPV6NetMaskLength = aIPV6MaskPrefixLength;
    13241331
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