[xpcom] Fix ref leak with DataCarrier values
authorKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 07:45:31 +0000 (10:45 +0300)
committerKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 07:45:59 +0000 (10:45 +0300)
xpcom-dbusservice/DBusMarshaling.cpp

index 0512263dafb350f67646b2d684cc74dcce6d9418..02f332df52b108d661fb1b625ee75a1b13b7b64c 100644 (file)
@@ -418,9 +418,10 @@ addVariantToIter(JSContext* cx, nsIVariant *aVariant, DBusMessageIter *aIter, DB
 
         nsCOMPtr<DBusDataCarrier> myCarrier = do_QueryInterface(is);
         if (myCarrier) {
-            nsCOMPtr<nsIVariant> myValue;
-            myCarrier->GetValue(getter_AddRefs(myValue));
+            nsIVariant *myValue;
+            myCarrier->GetValue(&myValue);
             addVariantToIter(cx, myValue, aIter, aSigIter);
+            NS_IF_RELEASE(myValue);
             return;
         }
     }