--nextPart2273266.v7ABriXX8T Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, As I'm not able to use reviewboard today, I'll ask here: The first part is to avoid a DIR leak. The second part is to avoid to use the same variable name into two nested=20 loops. gcc may work perfectly fine with it, but probably other compilers=20 (will) not. =2D-- strigi/src/luceneindexer/luceneindexer.cpp (revision 1041313) +++ strigi/src/luceneindexer/luceneindexer.cpp (copia de trabajo) @@ -46,6 +46,7 @@ checkIndexdirIsEmpty(const char* dir) { while (de) { if (strcmp(de->d_name, "..") && strcmp(de->d_name, ".")) { fprintf(stderr, "Directory %s is not empty.\n", dir); + closedir(d); return false; } de =3D readdir(d); =2D-- strigi/src/daemon/eventlistener/fslistener.cpp (revision 1041313) +++ strigi/src/daemon/eventlistener/fslistener.cpp (copia de trabajo) @@ -388,14 +388,14 @@ void FsListener::reindex() =20 calculateDiff(m_indexedDirs, reindexDirs, dirsDeleted, dirsCreated); =20 =2D for (set::iterator iter =3D dirsCreated.begin(); =2D iter !=3D dirsCreated.end() && !reindexReq(); ++iter) + for (set::iterator iter1 =3D dirsCreated.begin(); + iter1 !=3D dirsCreated.end() && !reindexReq(); ++iter1) { DirLister lister(m_pAnalyzerConfiguration); string path; vector > dirs; =20 =2D lister.startListing (*iter); + lister.startListing (*iter1); int ret =3D lister.nextDir(path, dirs); =20 while (ret !=3D -1) { // The rest of the affected loop: vector >::iterator iter; for (iter =3D dirs.begin(); iter !=3D dirs.end(); iter++) { struct stat stats =3D iter->second; if (S_ISDIR(stats.st_mode)) {//dir set toWatch; recursivelyMonitor (iter->first, toWatch, events); // add new watches addWatches (toWatch); dirsMonitored.insert (iter->first); } else if (S_ISREG(stats.st_mode)) { //file events.push_back (new Event (Event::CREATED, iter- >first)); } } ret =3D lister.nextDir(path, dirs); --nextPart2273266.v7ABriXX8T Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEABECAAYFAkrnSksACgkQGTEZaQL1skgFMgCgryxa5B8WXlZzU6S4vqXHsIMo 9csAoNDW0l0WecW44Z0cNt1+7Q0DGt96 =N1bb -----END PGP SIGNATURE----- --nextPart2273266.v7ABriXX8T--