[Bug 544908] New: talk-0.17-684.83: two missing calls to close
http://bugzilla.novell.com/show_bug.cgi?id=544908 Summary: talk-0.17-684.83: two missing calls to close Classification: openSUSE Product: openSUSE 11.2 Version: Factory Platform: All OS/Version: openSUSE 11.1 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: dcb314@hotmail.com QAContact: qa@suse.de Found By: --- I just had a look at factory package talk-0.17-684.83 source code file netkit-ntalk-0.17/talkd/announce.c function announce_proc I notice the following code fd = open(full_tty, O_WRONLY|O_NOCTTY); if (fd<0) { return (PERMISSION_DENIED); } if (fstat(fd, &stbuf) < 0) { return (PERMISSION_DENIED); } if ((stbuf.st_mode&020) == 0) { return (PERMISSION_DENIED); } print_mesg(fd, request, remote_machine); close(fd); return SUCCESS; It seems that close is called only on SUCCESS. This is a resource leak. Suggest new code fd = open(full_tty, O_WRONLY|O_NOCTTY); if (fd<0) { return (PERMISSION_DENIED); } if (fstat(fd, &stbuf) < 0) { close(fd); return (PERMISSION_DENIED); } if ((stbuf.st_mode&020) == 0) { close(fd); return (PERMISSION_DENIED); } print_mesg(fd, request, remote_machine); close(fd); return SUCCESS; -- 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=544908
Marcus Meissner
http://bugzilla.novell.com/show_bug.cgi?id=544908
Michal Seben
http://bugzilla.novell.com/show_bug.cgi?id=544908
User rschweikert@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=544908#c1
Robert Schweikert
http://bugzilla.novell.com/show_bug.cgi?id=544908
User rguenther@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=544908#c2
--- Comment #2 from Richard Guenther
http://bugzilla.novell.com/show_bug.cgi?id=544908
http://bugzilla.novell.com/show_bug.cgi?id=544908#c
Michal Seben
http://bugzilla.novell.com/show_bug.cgi?id=544908
http://bugzilla.novell.com/show_bug.cgi?id=544908#c3
Michal Seben
participants (1)
-
bugzilla_noreply@novell.com