diff options
author | msmith <msmith@FreeBSD.org> | 2000-02-17 02:19:19 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 2000-02-17 02:19:19 +0000 |
commit | 8564307eff91ba475563b039cbe2edd8d69cdb97 (patch) | |
tree | bf72d4d987c5fcb41858a75ced16a0159048a6ac /sys/boot/common/module.c | |
parent | e3f028acc0a7ebad3eb00303b0de95648e28a475 (diff) | |
download | FreeBSD-src-8564307eff91ba475563b039cbe2edd8d69cdb97.zip FreeBSD-src-8564307eff91ba475563b039cbe2edd8d69cdb97.tar.gz |
Close a file descriptor leak in the code which loads file objects.
Submitted by: Paul Saab <paul@mu.org>
Approved by: jkh
Diffstat (limited to 'sys/boot/common/module.c')
-rw-r--r-- | sys/boot/common/module.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/boot/common/module.c b/sys/boot/common/module.c index 63f1c9f..fb402af 100644 --- a/sys/boot/common/module.c +++ b/sys/boot/common/module.c @@ -262,6 +262,7 @@ mod_loadobj(char *type, char *name) if (got < 0) { /* error */ sprintf(command_errbuf, "error reading '%s': %s", name, strerror(errno)); free(name); + close(fd); return(CMD_ERROR); } laddr += got; @@ -282,6 +283,7 @@ mod_loadobj(char *type, char *name) /* Add to the list of loaded modules */ mod_append(mp); + close(fd); return(CMD_OK); } |