From 71c3227ba260b964b0c9516f05ad4f2e6fa72f69 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 27 Nov 2009 15:10:16 +0100 Subject: Fix memory leak in the DNotify implementation of QFileSystemWatcher Make sure that all calls to opendir() are paired with a call closedir(). Reviewed-by: Marius Storm-Olsen Task-number: QTBUG-4840 --- src/corelib/io/qfilesystemwatcher_dnotify.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/io/qfilesystemwatcher_dnotify.cpp b/src/corelib/io/qfilesystemwatcher_dnotify.cpp index 17ac9c6..03172e5 100644 --- a/src/corelib/io/qfilesystemwatcher_dnotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_dnotify.cpp @@ -295,6 +295,9 @@ QStringList QDnotifyFileSystemWatcherEngine::addPaths(const QStringList &paths, pathToFD.insert(path, fd); if(parentFd) parentToFD.insert(parentFd, fd); + + ::closedir(d); + if(parent) ::closedir(parent); } Directory &directory = fdToDirectory[fd]; -- cgit v0.12 From 10b5653ad4f25c6f37d640facf4a5ef01fe25926 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 27 Nov 2009 15:14:45 +0100 Subject: QNetworkReply autotest: adapt to QNetworkCookieJar change with commit 0d20ec8604b318ceafd6c35dfe1d73519bf024d3 I changed QNetworkCookieJar behavior, this commit adapts the QNetworkReply autotest to it. Reviewed-by: TrustMe --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 5fe716a..6d43c1d 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -3241,8 +3241,11 @@ void tst_QNetworkReply::receiveCookiesFromHttp_data() cookie = QNetworkCookie("a", "b"); cookie.setPath("/not/part-of-path"); header << cookie; + cookie.setDomain(QtNetworkSettings::serverName()); + jar << cookie; QTest::newRow("invalid-cookie-path") << "a=b; path=/not/part-of-path" << header << jar; + jar.clear(); cookie = QNetworkCookie("a", "b"); cookie.setDomain(".example.com"); header.clear(); -- cgit v0.12