Bug 1334104 - 'if' statement is unnecessary
Removed unnecessary `if` statements intended to safely delete pointers. Deleting a null pointer has no effect, and the behavior is defined.
MozReview-Commit-ID: 5zfMZoPoWcY
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -3130,33 +3130,31 @@ nsPluginHost::ReadPluginInfo()
if (line != mtr)
break;
mimetypes[mtr] = values[1];
mimedescriptions[mtr] = values[2];
extensions[mtr] = values[3];
}
if (mtr != mimetypecount) {
- if (heapalloced) {
- delete [] heapalloced;
- }
+ delete [] heapalloced;
return rv;
}
RefPtr<nsPluginTag> tag = new nsPluginTag(name,
description,
filename,
fullpath,
version,
(const char* const*)mimetypes,
(const char* const*)mimedescriptions,
(const char* const*)extensions,
mimetypecount, lastmod, fromExtension, true);
- if (heapalloced)
- delete [] heapalloced;
+
+ delete [] heapalloced;
// Import flags from registry into prefs for old registry versions
MOZ_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_BASIC,
("LoadCachedPluginsInfo : Loading Cached plugininfo for %s\n", tag->FileName().get()));
if (!ShouldAddPlugin(tag)) {
continue;
}