VirtualBox

Changeset 56604 in vbox


Ignore:
Timestamp:
Jun 23, 2015 2:47:32 PM (9 years ago)
Author:
vboxsync
Message:

xpcom/java: fixed two memory leaks

Location:
trunk/src/libs/xpcom18a4/java/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/java/src/nsJavaInterfaces.cpp

    r46649 r56604  
    505505        rv = JavaObjectToNativeInterface(env, aJavaObject, iid, &xpcomObject);
    506506        if (NS_SUCCEEDED(rv)) {
    507           rv = ((nsISupports*) xpcomObject)->QueryInterface(iid, &xpcomObject);
     507          nsISupports *xpcom_nat_obj = (nsISupports*) xpcomObject;
     508          rv = xpcom_nat_obj->QueryInterface(iid, &xpcomObject);
     509          NS_IF_RELEASE(xpcom_nat_obj);
    508510        }
    509511      } else {
  • trunk/src/libs/xpcom18a4/java/src/nsJavaWrapper.cpp

    r50393 r56604  
    758758        if (NS_FAILED(rv))
    759759          break;
    760         rv = ((nsISupports*) xpcom_obj)->QueryInterface(iid, &xpcom_obj);
     760        NS_ENSURE_TRUE(xpcom_obj, NS_ERROR_FAILURE);
     761        nsISupports *xpcom_nat_obj = (nsISupports*) xpcom_obj;
     762        rv = xpcom_nat_obj->QueryInterface(iid, &xpcom_obj);
     763        NS_IF_RELEASE(xpcom_nat_obj);
    761764        if (NS_FAILED(rv))
    762765          break;
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