Bug 1196378 - Fix mismatched js_new/js_free in ShellPrincipals, r=fitzgen
authorSteve Fink <sfink@mozilla.com>
Wed, 19 Aug 2015 11:29:32 -0700
changeset 287178 42ac4229e5f15ab5ceea77f64e1342a46016f439
parent 287177 bdb54665c61c46ab4770f921dd3385d771989496
child 287179 df49a79ef2ad3f85b581558282cc7570a77f013e
push id4660
push usermartin.thomson@gmail.com
push dateFri, 21 Aug 2015 22:37:38 +0000
reviewersfitzgen
bugs1196378
milestone43.0a1
Bug 1196378 - Fix mismatched js_new/js_free in ShellPrincipals, r=fitzgen
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -222,17 +222,17 @@ class ShellPrincipals: public JSPrincipa
   public:
     explicit ShellPrincipals(uint32_t bits, int32_t refcount = 0) : bits(bits) {
         this->refcount = refcount;
     }
 
     static void destroy(JSPrincipals* principals) {
         MOZ_ASSERT(principals != &fullyTrusted);
         MOZ_ASSERT(principals->refcount == 0);
-        js_free(static_cast<ShellPrincipals*>(principals));
+        js_delete(static_cast<const ShellPrincipals*>(principals));
     }
 
     static bool subsumes(JSPrincipals* first, JSPrincipals* second) {
         uint32_t firstBits  = getBits(first);
         uint32_t secondBits = getBits(second);
         return (firstBits | secondBits) == firstBits;
     }