diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-09-20 17:57:30 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-09-26 21:14:49 +0200 |
commit | 5222abfdf5f034bad12bbe12312a4149550495b7 (patch) | |
tree | c37d6f11db5e996611fa9f54dcb0ddcd34aeb516 | |
parent | 097b641c3eb588f1707f87e6a9bedb1d3d8cc31d (diff) |
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>
-rw-r--r-- | src/tools/uic/uic.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp index be4df64696..265f578524 100644 --- a/src/tools/uic/uic.cpp +++ b/src/tools/uic/uic.cpp @@ -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; } |