VirtualBox

Ignore:
Timestamp:
Apr 23, 2008 12:49:49 PM (17 years ago)
Author:
vboxsync
Message:

r=bird: Plugged two more leaks in the error handling. (there are more, please fix)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c

    r8326 r8327  
    280280    /* Lock down user pages */
    281281    int rc = as_pagelock(useras, &ppl, (caddr_t)R3Ptr, cb, S_WRITE);
    282     if (rc != 0)
    283     {
    284         cmn_err(CE_NOTE,"rtR0MemObjNativeLockUser: as_pagelock failed rc=%d\n", rc);
    285         return VERR_LOCK_FAILED;
    286     }
    287 
    288     if (!ppl)
    289     {
     282    if (!rc)
     283    {
     284        if (ppl)
     285        {
     286            pMemSolaris->Core.u.Lock.R0Process = (RTR0PROCESS)userproc;
     287            pMemSolaris->ppShadowPages = ppl;
     288            *ppMem = &pMemSolaris->Core;
     289            return VINF_SUCCESS;
     290        }
     291
    290292        as_pageunlock(useras, ppl, (caddr_t)R3Ptr, cb, S_WRITE);
    291293        cmn_err(CE_NOTE, "rtR0MemObjNativeLockUser: as_pagelock failed to get shadow pages\n");
    292         return VERR_LOCK_FAILED;
    293     }
    294 
    295     pMemSolaris->Core.u.Lock.R0Process = (RTR0PROCESS)userproc;
    296     pMemSolaris->ppShadowPages = ppl;
    297     *ppMem = &pMemSolaris->Core;
    298     return VINF_SUCCESS;
     294    }
     295    else
     296        cmn_err(CE_NOTE,"rtR0MemObjNativeLockUser: as_pagelock failed rc=%d\n", rc);
     297    rtR0MemObjDelete(pMemSolaris);
     298    return VERR_LOCK_FAILED;
    299299}
    300300
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