Close a file descriptor leak in the code which loads file objects.

Submitted by:	Paul Saab <paul@mu.org>
Approved by:	jkh
This commit is contained in:
msmith 2000-02-17 02:19:19 +00:00
parent e3f028acc0
commit 8564307eff

View File

@ -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);
}