MimeDatabase: Fix leak on invalid magic

Introduced by 673be1a3f8

Change-Id: Ia937b3607d6a709b86185f428a6e3ff1202e0869
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Eike Ziller
2015-03-09 12:15:43 +01:00
parent 220882128a
commit 6ecde4cdf0

View File

@@ -188,8 +188,10 @@ static bool createMagicMatchRule(const QXmlStreamAttributes &atts,
MimeMagicRule *tempRule = new MimeMagicRule(magicType, value.toUtf8(), startPos, endPos, MimeMagicRule *tempRule = new MimeMagicRule(magicType, value.toUtf8(), startPos, endPos,
mask.toLatin1(), errorMessage); mask.toLatin1(), errorMessage);
if (!tempRule->isValid()) if (!tempRule->isValid()) {
delete tempRule;
return false; return false;
}
rule = tempRule; rule = tempRule;
return true; return true;