VirtualBox

Changeset 24390 in vbox


Ignore:
Timestamp:
Nov 5, 2009 2:44:51 PM (15 years ago)
Author:
vboxsync
Message:

VbglR3GetAdditionsVersion: Missing RTStrFree on failure. Fixed uninitialized rc warning. Fixed the #ifdef indentation again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp

    r24384 r24390  
    238238VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszRev)
    239239{
    240 # ifdef RT_OS_WINDOWS
     240#ifdef RT_OS_WINDOWS
    241241    /*
    242242     * Try get the *installed* version first.
     
    269269
    270270    /* Did we get something worth looking at? */
    271     int rc;
     271    int rc = VINF_SUCCESS;
    272272    if (r == ERROR_SUCCESS)
    273273    {
     
    321321            else
    322322                rc = VERR_NO_MEMORY;
     323
     324            if (RT_FAILURE(rc) && ppszVer)
     325            {
     326                RTStrFree(*ppszVer);
     327                *ppszVer = NULL;
     328            }
    323329        }
    324330        if (hKey != NULL)
     
    335341    return rc;
    336342
    337 # else /* !RT_OS_WINDOWS */
     343#else /* !RT_OS_WINDOWS */
    338344    /*
    339345     * On non-Windows platforms just return the compile-time version string.
    340346     */
    341347    return vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszRev);
    342 # endif /* !RT_OS_WINDOWS */
    343 }
     348#endif /* !RT_OS_WINDOWS */
     349}
     350
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