Bug 1167083: Fix memory leak in Windows low integrity temp clean up code. r=billm

This commit is contained in:
Bob Owen 2015-05-22 07:50:54 +01:00
Родитель 6df5b901f2
Коммит 3ed5cce4c6
2 изменённых файлов: 28 добавлений и 20 удалений

Просмотреть файл

@ -5,7 +5,7 @@
},
"global": {
"talos_repo": "https://hg.mozilla.org/build/talos",
"talos_revision": "a6052c33d420"
"talos_revision": "e04283e4f2b2"
},
"extra_options": {
"android": [ "--apkPath=%(apk_path)s" ]

Просмотреть файл

@ -676,26 +676,10 @@ SetUpSandboxEnvironment()
}
}
static void
CleanUpSandboxEnvironment()
{
// We can't have created a low integrity temp before Vista.
if (!IsVistaOrLater()) {
return;
}
// Get temp directory suffix pref.
nsAdoptingString tempDirSuffix =
Preferences::GetString("security.sandbox.content.tempDirSuffix");
if (tempDirSuffix.IsEmpty()) {
return;
}
// Get and remove the low integrity Mozilla temp directory.
// This function already warns if the deletion fails.
unused << GetAndCleanLowIntegrityTemp(tempDirSuffix);
#if defined(NIGHTLY_BUILD)
static void
CleanUpOldSandboxEnvironment()
{
// Temporary code to clean up the old low integrity temp directories.
// The removal of this is tracked by bug 1165818.
nsCOMPtr<nsIFile> lowIntegrityMozilla;
@ -734,7 +718,31 @@ CleanUpSandboxEnvironment()
file->Remove(/* aRecursive */ true);
}
}
}
#endif
static void
CleanUpSandboxEnvironment()
{
// We can't have created a low integrity temp before Vista.
if (!IsVistaOrLater()) {
return;
}
#if defined(NIGHTLY_BUILD)
CleanUpOldSandboxEnvironment();
#endif
// Get temp directory suffix pref.
nsAdoptingString tempDirSuffix =
Preferences::GetString("security.sandbox.content.tempDirSuffix");
if (tempDirSuffix.IsEmpty()) {
return;
}
// Get and remove the low integrity Mozilla temp directory.
// This function already warns if the deletion fails.
nsCOMPtr<nsIFile> lowIntegrityTemp = GetAndCleanLowIntegrityTemp(tempDirSuffix);
}
#endif