VirtualBox

Changeset 31933 in vbox for trunk


Ignore:
Timestamp:
Aug 24, 2010 3:59:54 PM (14 years ago)
Author:
vboxsync
Message:

VBoxService/PropCache: Fixed deadlock in error case.

File:
1 edited

Legend:

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

    r31925 r31933  
    303303        va_end(va);
    304304        if (!pszPath)
    305             return VERR_NO_STR_MEMORY;
    306 
    307         /* Iterate through all nodes and compare their paths. */
    308         RTListForEach(&pCache->NodeHead, pNodeIt, VBOXSERVICEVEPROPCACHEENTRY, NodeSucc)
    309         {
    310             if (RTStrStr(pNodeIt->pszName, pszPath) == pNodeIt->pszName)
    311             {
    312                 /** @todo Use some internal function to update the node directly, this is slow atm. */
    313                 rc = VBoxServicePropCacheUpdate(pCache, pNodeIt->pszName, pszValue);
    314             }
    315             if (RT_FAILURE(rc))
    316                 break;
    317         }
    318         RTStrFree(pszPath);
     305        {
     306            rc = VERR_NO_STR_MEMORY;
     307        }
     308        else
     309        {
     310            /* Iterate through all nodes and compare their paths. */
     311            RTListForEach(&pCache->NodeHead, pNodeIt, VBOXSERVICEVEPROPCACHEENTRY, NodeSucc)
     312            {
     313                if (RTStrStr(pNodeIt->pszName, pszPath) == pNodeIt->pszName)
     314                {
     315                    /** @todo Use some internal function to update the node directly, this is slow atm. */
     316                    rc = VBoxServicePropCacheUpdate(pCache, pNodeIt->pszName, pszValue);
     317                }
     318                if (RT_FAILURE(rc))
     319                    break;
     320            }
     321            RTStrFree(pszPath);
     322        }
    319323        RTCritSectLeave(&pCache->CritSect);
    320324    }
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