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:
Mike Smith 2000-02-17 02:19:19 +00:00
parent 0169694662
commit 51b5739aaf
1 changed files with 2 additions and 0 deletions

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