[Bug 530313] New: sane-backends-1.0.20-3.5: missing call to closedir
http://bugzilla.novell.com/show_bug.cgi?id=530313 Summary: sane-backends-1.0.20-3.5: missing call to closedir Classification: openSUSE Product: openSUSE 11.2 Version: Factory Platform: All OS/Version: openSUSE 11.1 Status: NEW Severity: Normal Priority: P5 - None Component: Printing AssignedTo: jsmeix@novell.com ReportedBy: dcb314@hotmail.com QAContact: jsmeix@novell.com Found By: --- I just had a look at factory package sane-backends-1.0.20-3.5 For source code file sane-backends-1.0.20/tools/sane-desc.c around line 800 is the source code for the function read_files. I notice the following line of code if ((dir = opendir (search_dir)) == 0) but I fail to notice a matching call to closedir. This looks like a resource leak to me. Suggest add call to closedir. -- 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.
http://bugzilla.novell.com/show_bug.cgi?id=530313 Johannes Meixner <jsmeix@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P4 - Low Status|NEW |ASSIGNED OS/Version|openSUSE 11.1 |SuSE Other -- 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.
http://bugzilla.novell.com/show_bug.cgi?id=530313 Johannes Meixner <jsmeix@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Printing |Other QAContact|jsmeix@novell.com |qa@suse.de -- 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.
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.
http://bugzilla.novell.com/show_bug.cgi?id=530313 User jsmeix@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=530313#c2 --- Comment #2 from Johannes Meixner <jsmeix@novell.com> 2009-08-13 06:46:38 MDT --- Created an attachment (id=312642) --> (http://bugzilla.novell.com/attachment.cgi?id=312642) sane-desc_closedir.patch The upstream bug report is https://alioth.debian.org/tracker/index.php?func=detail&aid=311880&group_id=30186&atid=410366 Fixed via the attached patch in graphics/sane-backends and made a submitreq to openSUSE:Factory: 17700 State:new Creator:jsmeix When:2009-08-13T14:45:04 submit: graphics/sane-backends -> openSUSE:Factory Comment: 'Fixed bnc#530313' -- 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.
http://bugzilla.novell.com/show_bug.cgi?id=530313 User jsmeix@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=530313#c3 Johannes Meixner <jsmeix@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED Target Milestone|--- |Factory --- Comment #3 from Johannes Meixner <jsmeix@novell.com> 2009-08-13 06:47:26 MDT --- . -- 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.
http://bugzilla.novell.com/show_bug.cgi?id=530313 http://bugzilla.novell.com/show_bug.cgi?id=530313#c4 --- Comment #4 from Bernhard Wiedemann <bwiedemann@suse.com> --- This is an autogenerated message for OBS integration: This bug (530313) was mentioned in https://build.opensuse.org/request/show/17700 Factory / sane-backends -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com