From 5222abfdf5f034bad12bbe12312a4149550495b7 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sat, 20 Sep 2014 17:57:30 +0200 Subject: 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 Reviewed-by: hjk --- src/tools/uic/uic.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tools/uic') 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; } -- cgit v1.2.3