diff options
author | Moonchild <moonchild@palemoon.org> | 2019-12-22 23:50:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-22 23:50:30 +0000 |
commit | 84f4806b4656253faefd534cb59da27241608752 (patch) | |
tree | c800fd84e35dd5749c69aad87f8f0d503331e1f0 | |
parent | 492624a7106ecbc18994b465ca1dd23fa472bf7e (diff) | |
parent | 4e6294b248390e60e1a39eef4cebff3c288dd7a6 (diff) | |
download | uxp-84f4806b4656253faefd534cb59da27241608752.tar.gz |
Merge pull request #1334 from g4jc/bug1333
Don't hang on to pointer from temporary NS_LossyConvertUTF16toASCII.
-rw-r--r-- | dom/media/CubebUtils.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/dom/media/CubebUtils.cpp b/dom/media/CubebUtils.cpp index 0f0167d9c0..6bb846afe2 100644 --- a/dom/media/CubebUtils.cpp +++ b/dom/media/CubebUtils.cpp @@ -203,11 +203,10 @@ void InitBrandName() NS_SUCCEEDED(rv), "Could not get the program name for a cubeb stream."); } } - /* cubeb expects a c-string. */ - const char* ascii = NS_LossyConvertUTF16toASCII(brandName).get(); - sBrandName = new char[brandName.Length() + 1]; - PodCopy(sBrandName.get(), ascii, brandName.Length()); - sBrandName[brandName.Length()] = 0; + NS_LossyConvertUTF16toASCII ascii(brandName); + sBrandName = new char[ascii.Length() + 1]; + PodCopy(sBrandName.get(), ascii.get(), ascii.Length()); + sBrandName[ascii.Length()] = 0; } cubeb* GetCubebContextUnlocked() |