Commit 336c3159 authored by Tobias Hunger's avatar Tobias Hunger Committed by Oswald Buddenhagen
Browse files

QmakeParser: Do not leak temporaries into cache of files

This prevents an access to free'd memory when opening

Looks like gets added to that cache in QMakeVfs::writeFile
with part of the including pro-file's filename in it. That part gets
cleaned when that containing ProFile goes out of scope, leaving a key in
QMakeVfs::m_files free'd but accessible.

Change-Id: I80b43d2fbb66c214647497ea97e6e3a587e274d6
Reviewed-by: default avatarOswald Buddenhagen <>
parent 2363ea6d
......@@ -1531,7 +1531,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
if (!"append"), Qt::CaseInsensitive))
mode = QIODevice::Append;
return writeFile(QString(), resolvePath(, mode, contents);
QString path = resolvePath(;
path.detach(); // make sure to not leak m_tmp1 into the map of written files.
return writeFile(QString(), path, mode, contents);
case T_TOUCH: {
if (args.count() != 2) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment