VirtualBox

Changeset 25942 in vbox for trunk/src/VBox/Main/freebsd


Ignore:
Timestamp:
Jan 20, 2010 5:26:22 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56784
Message:

*: RTEnv usage cleanup - avoid RTEnvGet() as it doesn't necessarily return UTF-8 encoded strings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/freebsd/HostHardwareFreeBSD.cpp

    r25728 r25942  
    341341    int rc = VINF_SUCCESS;
    342342    bool success = false;
     343    char *pszFreeMe = RTEnvDupEx(RTENV_DEFAULT, pcszVar);
    343344
    344345    try
    345346    {
    346         const char *pcszCurrent = RTEnvGet (pcszVar);
     347        const char *pcszCurrent = pszFreeMe;
    347348        while (pcszCurrent && *pcszCurrent != '\0')
    348349        {
     
    357358            if (RT_SUCCESS(RTPathReal(szPath, szReal, sizeof(szReal))))
    358359            {
     360                szUdi[0] = '\0'; /** @todo r=bird: missing a call to devValidateDevice() here and szUdi wasn't
     361                                  *        initialized because of that.  Need proper fixing. */
    359362                pList->push_back(DriveInfo(szReal, szUdi, szDesc));
    360363                success = true;
     
    369372        rc = VERR_NO_MEMORY;
    370373    }
    371     LogFlowFunc (("rc=%Rrc, success=%d\n", rc, success));
     374    RTStrFree(pszFreeMe);
     375    LogFlowFunc(("rc=%Rrc, success=%d\n", rc, success));
    372376    return rc;
    373377}
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