VirtualBox

Ignore:
Timestamp:
Oct 16, 2008 1:16:33 PM (16 years ago)
Author:
vboxsync
Message:

#3230: Memory leaks fixed in VHD backend

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp

    r13295 r13340  
    635635        if (VBOX_FAILURE(rc)) \
    636636        { \
     637            if (pvBuf) \
     638                RTMemFree(pvBuf); \
    637639            VDDestroy(pVD); \
    638640            return rc; \
    639641        } \
    640642    } while (0)
     643
     644    void *pvBuf = RTMemAlloc(_1M);
    641645
    642646    /* Create error interface. */
     
    672676    PSEGMENT paSegments  = (PSEGMENT)RTMemAllocZ(sizeof(struct Segment) * (nSegments + 1));
    673677
    674     void *pvBuf = RTMemAlloc(_1M);
    675 
    676678    RNDCTX ctx;
    677679    initializeRandomGenerator(&ctx, u32Seed);
     
    692694
    693695    VDDestroy(pVD);
     696    if (pvBuf)
     697        RTMemFree(pvBuf);
    694698#undef CHECK
    695699    return 0;
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