VirtualBox

Changeset 28972 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
May 3, 2010 12:25:23 PM (15 years ago)
Author:
vboxsync
Message:

VBoxService/PropCache: Bugfixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp

    r28969 r28972  
    9595    va_list va;
    9696    va_start(va, pszValueFormat);
    97     int rc = VBoxServicePropCacheUpdate(pCache, pszName, 0 /* Not used */, NULL /* Not used */, pszValueFormat, va);
     97    char *pszValue;
     98    int rc = RTStrAPrintfV(&pszValue, pszValueFormat, va);
     99    if (RT_SUCCESS(rc))
     100    {
     101        rc = VBoxServicePropCacheUpdateEx(pCache, pszName, 0 /* Not used */, NULL /* Not used */, pszValue);
     102        RTStrFree(pszValue);
     103    }
    98104    va_end(va);
    99105    return rc;
     
    137143            if (pNode->uFlags & VBOXSERVICEPROPCACHEFLAG_ALWAYS_UPDATE)
    138144                fUpdate = true;
    139             else if (strcmp(pNode->pszValue, pszValue) != 0)
     145            else if (pNode->pszValue && strcmp(pNode->pszValue, pszValue) != 0)
    140146                fUpdate = true;
    141147
     
    170176    {
    171177        PVBOXSERVICEVEPROPCACHEENTRY pNewNode = (PVBOXSERVICEVEPROPCACHEENTRY)RTMemAlloc(sizeof(VBOXSERVICEVEPROPCACHEENTRY));
    172         pNode->pszName = RTStrDup(pszName);
     178        pNewNode->pszName = RTStrDup(pszName);
    173179        if (pszValue)
    174             pNode->pszValue = RTStrDup(pszValue);
     180            pNewNode->pszValue = RTStrDup(pszValue);
    175181        else
    176             pNode->pszValue = NULL;
     182            pNewNode->pszValue = NULL;
    177183         if (pszValueReset)
    178             pNode->pszValueReset = RTStrDup(pszValueReset);
     184            pNewNode->pszValueReset = RTStrDup(pszValueReset);
    179185        else
    180             pNode->pszValueReset = NULL;
     186            pNewNode->pszValueReset = NULL;
    181187        pNewNode->uFlags = u32Flags;
    182188        /*rc =*/ RTListAppend(&pCache->Node, &pNewNode->Node);
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