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:
parent
e3f028acc0
commit
8564307eff
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user