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.