VirtualBox

Changeset 86398 in vbox


Ignore:
Timestamp:
Oct 1, 2020 7:03:08 PM (4 years ago)
Author:
vboxsync
Message:

xpcom/TestCOMPtr: Fixed use-after-free issue in IFoo::Release. bugref:9841

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/tests/TestCOMPtr.cpp

    r40300 r86398  
    158158      printf(">>");
    159159     
    160     --refcount_;
     160    nsrefcnt const newcount = --refcount_;
    161161    printf("IFoo@%p::Release(), refcount --> %d\n",
    162            STATIC_CAST(void*, this), refcount_);
    163 
    164     if ( !refcount_ )
     162           STATIC_CAST(void*, this), newcount);
     163
     164    if ( !newcount )
    165165      {
    166166        printf("  delete IFoo@%p\n", STATIC_CAST(void*, this));
     
    171171      printf("<<IFoo@%p::Release()\n", STATIC_CAST(void*, this));
    172172
    173     return refcount_;
     173    return newcount;
    174174  }
    175175
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