Uic: fix a leak
There are a couple of code paths in which we return from a function without freeing the memory pointed by a local pointer. For the sake of not over-modifying the code, I chose not to turn "ui" into a scoped pointer. Change-Id: I0b23944f7526d250c1ebeca0bae9bdc36dceceed Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>bb10
parent
097b641c3e
commit
5222abfdf5
|
|
@ -219,6 +219,7 @@ bool Uic::write(QIODevice *in)
|
|||
#ifdef QT_UIC_JAVA_GENERATOR
|
||||
if (language.toLower() != QLatin1String("jambi")) {
|
||||
fprintf(stderr, "uic: File is not a 'jambi' form\n");
|
||||
delete ui;
|
||||
return false;
|
||||
}
|
||||
rtn = jwrite (ui);
|
||||
|
|
@ -229,6 +230,7 @@ bool Uic::write(QIODevice *in)
|
|||
#ifdef QT_UIC_CPP_GENERATOR
|
||||
if (!language.isEmpty() && language.toLower() != QLatin1String("c++")) {
|
||||
fprintf(stderr, "uic: File is not a 'c++' ui file, language=%s\n", qPrintable(language));
|
||||
delete ui;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue