Bug 1142817 - Use UniquePtr in testXDR_sourceMap. r=erahm

This commit is contained in:
ShubhamSinha 2015-05-19 15:19:39 +05:30
parent d49f96c2aa
commit 40a443dfad

View File

@ -12,6 +12,8 @@
#include "jsscriptinlines.h"
using mozilla::UniquePtr;
static JSScript*
FreezeThaw(JSContext* cx, JS::HandleScript script)
{
@ -129,7 +131,8 @@ BEGIN_TEST(testXDR_sourceMap)
CHECK(script);
size_t len = strlen(*sm);
char16_t* expected = js::InflateString(cx, *sm, &len);
UniquePtr<char16_t,JS::FreePolicy> expected_wrapper(js::InflateString(cx, *sm, &len));
char16_t *expected = expected_wrapper.get();
CHECK(expected);
// The script source takes responsibility of free'ing |expected|.