summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-11-27 14:10:16 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-11-27 14:18:01 (GMT)
commit71c3227ba260b964b0c9516f05ad4f2e6fa72f69 (patch)
tree89e49421c8aa1162ad5c5a384502db74af1b6062 /src
parentef17dac74688a8754aa4434a24ddb19d2ab4dcc5 (diff)
downloadQt-71c3227ba260b964b0c9516f05ad4f2e6fa72f69.zip
Qt-71c3227ba260b964b0c9516f05ad4f2e6fa72f69.tar.gz
Qt-71c3227ba260b964b0c9516f05ad4f2e6fa72f69.tar.bz2
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
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qfilesystemwatcher_dnotify.cpp3
1 files changed, 3 insertions, 0 deletions
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];