ToolChains: Fix theoretically possible null pointer access

This can not be triggered right now, but somebody might run into this
later.

Change-Id: Ibc635e7dca1db7ab77376b5373db67dcdd2bb46e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2015-10-14 11:13:07 +02:00
parent 6cb205363a
commit 924c8bf8b1

View File

@@ -831,10 +831,10 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(const QString &comp
foreach (const Abi &abi, abiList) { foreach (const Abi &abi, abiList) {
QScopedPointer<GccToolChain> tc(createToolChain(true)); QScopedPointer<GccToolChain> tc(createToolChain(true));
tc->setMacroCache(QStringList(), macros);
if (tc.isNull()) if (tc.isNull())
return result; return result;
tc->setMacroCache(QStringList(), macros);
tc->setCompilerCommand(compilerPath); tc->setCompilerCommand(compilerPath);
tc->setSupportedAbis(abiList); tc->setSupportedAbis(abiList);
tc->setTargetAbi(abi); tc->setTargetAbi(abi);