Page MenuHomeFreeBSD

D61840.1795297831.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61840.1795297831.diff

diff --git a/stand/i386/loader/chain.c b/stand/i386/loader/chain.c
--- a/stand/i386/loader/chain.c
+++ b/stand/i386/loader/chain.c
@@ -103,12 +103,18 @@
if (argv[1][len-1] != ':') {
if (fstat(fd, &st) == -1) {
command_errmsg = "stat failed";
+#ifdef LOADER_VERIEXEC_VECTX
+ free(vctx);
+#endif
close(fd);
return (CMD_ERROR);
}
size = st.st_size;
} else if (strncmp(argv[1], "disk", 4) != 0) {
command_errmsg = "can only use disk device";
+#ifdef LOADER_VERIEXEC_VECTX
+ free(vctx);
+#endif
close(fd);
return (CMD_ERROR);
}
@@ -116,22 +122,29 @@
i386_getdev((void **)(&rootdev), argv[1], NULL);
if (rootdev == NULL) {
command_errmsg = "can't determine root device";
+#ifdef LOADER_VERIEXEC_VECTX
+ free(vctx);
+#endif
close(fd);
return (CMD_ERROR);
}
if (archsw.arch_readin(VECTX_HANDLE(fd), mem, size) != size) {
command_errmsg = "failed to read disk";
+#ifdef LOADER_VERIEXEC_VECTX
+ free(vctx);
+#endif
close(fd);
return (CMD_ERROR);
}
- close(fd);
#ifdef LOADER_VERIEXEC_VECTX
verror = vectx_close(vctx, __func__);
if (verror) {
+ close(fd);
return (CMD_ERROR);
}
#endif
+ close(fd);
if (argv[1][len-1] == ':' &&
*((uint16_t *)PTOV(mem + DOSMAGICOFFSET)) != DOSMAGIC) {
command_errmsg = "wrong magic";

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 21, 9:50 PM (19 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41894685
Default Alt Text
D61840.1795297831.diff (1 KB)

Event Timeline