NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
port-hppa/50532: src/sys/arch/hppa/stand/xxboot/iplsum.c: 2 * resource leaks ?
>Number: 50532
>Category: port-hppa
>Synopsis: src/sys/arch/hppa/stand/xxboot/iplsum.c: 2 * resource leaks ?
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: port-hppa-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Dec 11 10:30:00 +0000 2015
>Originator: David Binderman
>Release: cvs dated 20151210
>Organization:
>Environment:
>Description:
[src/sys/arch/hppa/stand/xxboot/iplsum.c:58]: (error) Resource leak: fp
[src/sys/arch/hppa/stand/xxboot/iplsum.c:61]: (error) Resource leak: fp
Source code is
if ((fp = fopen(argv[1], "rb")) == NULL) {
perror(argv[1]);
return 1;
}
if ((len = fread(bootblk, 1, sizeof bootblk, fp)) <= IPLOFF) {
fprintf(stderr, "%s: too short\n", argv[1]);
return 1;
} else if (len > BOOTSIZE) {
fprintf(stderr, "%s: too long (%d vs %d)\n", argv[1], len, BOOTSIZE);
return 1;
}
2 * fclose inside the if conditions looks to be a good idea.
>How-To-Repeat:
>Fix:
Home |
Main Index |
Thread Index |
Old Index