Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177793521
D61840.1795297814.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61840.1795297814.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 21, 9:50 PM (19 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41894685
Default Alt Text
D61840.1795297814.diff (1 KB)
Attached To
Mode
D61840: loader: i386: fix vectx handling in chain error paths
Attached
Detach File
Event Timeline