[Bug 536506] New: scsirastools-1.5.8-8.6: fopen in wrong place
http://bugzilla.novell.com/show_bug.cgi?id=536506 Summary: scsirastools-1.5.8-8.6: fopen in wrong place 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 scsirastools-1.5.8-8.6 For source code file scsirastools-1.5.8/src/sgdskfl.c around line 540, function getimage is the following code fdimg = fopen(filenm, "r"); /* try current directory */ if (fdimg == NULL) { /* if error, set default directory */ if (fdebug) showmsg("Cannot open %s, errno = %d\n", filenm, errno); strcpy(fullfilenm,defdir); strcat(fullfilenm,filenm); filenm = fullfilenm; } fdimg = fopen(filenm, "r"); /* try default directory */ Note how, if the first fopen succeeds, then the second fopen is pointless. This looks like a resource leak to me. Suggest new code fdimg = fopen(filenm, "r"); /* try current directory */ if (fdimg == NULL) { /* if error, set default directory */ if (fdebug) showmsg("Cannot open %s, errno = %d\n", filenm, errno); strcpy(fullfilenm,defdir); strcat(fullfilenm,filenm); filenm = fullfilenm; fdimg = fopen(filenm, "r"); /* try default directory */ } -- 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=536506
Dirk Mueller
http://bugzilla.novell.com/show_bug.cgi?id=536506
User rguenther@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=536506#c1
--- Comment #1 from Richard Guenther
http://bugzilla.novell.com/show_bug.cgi?id=536506
User hare@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=536506#c2
Hannes Reinecke
participants (1)
-
bugzilla_noreply@novell.com