http://bugzilla.novell.com/show_bug.cgi?id=530313 User jsmeix@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=530313#c1 --- Comment #1 from Johannes Meixner <jsmeix@novell.com> 2009-08-13 05:07:33 MDT --- I agree that closedir is really missing here because there could be several directories because the current code is ------------------------------------------------------------- while (search_dir && search_dir[0]) { .. if ((dir = opendir (search_dir)) == 0) { DBG_ERR ("cannot read directory `%s' (%s)\n", search_dir, strerror (errno)); return SANE_FALSE; } .. while ((dir_entry = readdir (dir)) != NULL) { .. } /* while (direntry) */ .. } ------------------------------------------------------------- which should be changed to ------------------------------------------------------------- while (search_dir && search_dir[0]) { .. if ((dir = opendir (search_dir)) == 0) { DBG_ERR ("cannot read directory `%s' (%s)\n", search_dir, strerror (errno)); return SANE_FALSE; } .. while ((dir_entry = readdir (dir)) != NULL) { .. } /* while (direntry) */ if ((closedir(dir) != 0) { DBG_ERR ("cannot close directory `%s' (%s)\n", search_dir, strerror (errno)); return SANE_FALSE; } .. } ------------------------------------------------------------- to be safe even if subsequent 'dir = opendir(...)' calls may implicitely close an already open directory stream. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.