VirtualBox

Changeset 41441 in vbox


Ignore:
Timestamp:
May 24, 2012 5:26:51 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
78172
Message:

VBoxTray/SharedFolders/win: fix double mem free crash

Location:
trunk/src/VBox/Additions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxSharedFolders.cpp

    r34613 r41441  
    3636        rc = VbglR3SharedFolderGetMappings(u32ClientId, true /* Only process auto-mounted folders */,
    3737                                           &paMappings, &cMappings);
    38         if (RT_SUCCESS(rc))
     38        if (RT_SUCCESS(rc) && cMappings)
    3939        {
    4040#if 0
     
    144144        rc = VbglR3SharedFolderGetMappings(u32ClientId, true /* Only process auto-mounted folders */,
    145145                                           &paMappings, &cMappings);
    146         if (RT_SUCCESS(rc))
     146        if (RT_SUCCESS(rc) && cMappings)
    147147        {
    148148            for (uint32_t i = 0; i < cMappings && RT_SUCCESS(rc); i++)
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp

    r40732 r41441  
    104104    int rc = VbglR3SharedFolderGetMappings(u32ClientId, true /* Only process auto-mounted folders */,
    105105                                           &paMappings, &cMappings);
    106     if (RT_SUCCESS(rc))
     106    if (RT_SUCCESS(rc) && cMappings)
    107107    {
    108108        for (uint32_t i = 0; i < cMappings && !fFound; i++)
     
    186186                    ppaMappingsTemp = (PVBGLR3SHAREDFOLDERMAPPING)pvNew;
    187187                }
    188                 else
    189                     *ppaMappings = ppaMappingsTemp;
    190188            }
    191189        }
     
    194192    if (   ppaMappingsTemp
    195193        && (RT_FAILURE(rc) || !*pcMappings))
     194    {
    196195        RTMemFree(ppaMappingsTemp);
     196        ppaMappingsTemp = NULL;
     197    }
     198
     199    *ppaMappings = ppaMappingsTemp;
    197200
    198201    return rc;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette