mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
4725fcb648
Before bug 552864, the string was created with PR_smprintf, and PR_SetEnv'ed (which, under the hood, just calls putenv). PR_smprintf was allocating the string on the heap. Now, it's allocated on the stack, and still putenv'ed. putenv kind of takes ownership of the strings it's being passed, so stack allocated strings are dangerous to use. It looks like we've been fairly lucky that it worked, presumably because compilers would keep the stack frame with the variable, but that's not guaranteed to happen, and in some case, doesn't. So we strdup the string and purposefully leak it instead, which matches what happened before bug 552864, and is the only "sane" way to use putenv. --HG-- extra : rebase_source : e39349f90f5346b591e20696c0c3c7fdb26c3cfb |
||
---|---|---|
.. | ||
app | ||
branding | ||
chrome | ||
components | ||
config | ||
dev | ||
gaia | ||
graphene | ||
installer | ||
locales | ||
simulator | ||
test | ||
app.mozbuild | ||
build.mk | ||
common.configure | ||
confvars.sh | ||
LICENSE | ||
Makefile.in | ||
moz.build | ||
moz.configure |