Comment on attachment 383040
leaking env in nsAppRunner.cpp (non garbage patch)
ok, here's a free r-,
// We intentionally leak |expr| here since it is required by PR_SetEnv.
the code is already trying to leak, but it's trying to leak an nspr pointer. If you're going to do this, just fix SaveWordToEnv to do:
Comment on attachment 383040
leaking env in nsAppRunner.cpp (non garbage patch)
ok, here's a free r-,
// We intentionally leak |expr| here since it is required by PR_SetEnv.
the code is already trying to leak, but it's trying to leak an nspr pointer. If you're going to do this, just fix SaveWordToEnv to do:
SaveWordToEnv(const char *name, const nsACString & word) "%s=%s" , name, PromiseFlatCStr ing(word) .get()) ;
{
char *expr = PR_smprintf(
if (!expr)
return;
/* this copy is intentionally leaked per setenv requirements */
PR_SetEnv (strdup (env));
PR_smprintf_ free(env) ;
}