mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:57:44 +00:00
Fix crash when process spawn fails.
This commit is contained in:
parent
c178d7a9e3
commit
8525cdd6a2
1 changed files with 5 additions and 2 deletions
|
@ -307,7 +307,8 @@ Task* Task::createUserTask(const String& path, uid_t uid, gid_t gid, pid_t paren
|
||||||
};
|
};
|
||||||
bool success = space.loadELF(move(elfData));
|
bool success = space.loadELF(move(elfData));
|
||||||
if (!success) {
|
if (!success) {
|
||||||
MM.remove_kernel_alias_for_region(*region, region_alias);
|
if (region)
|
||||||
|
MM.remove_kernel_alias_for_region(*region, region_alias);
|
||||||
delete t;
|
delete t;
|
||||||
kprintf("Failure loading ELF %s\n", path.characters());
|
kprintf("Failure loading ELF %s\n", path.characters());
|
||||||
error = -ENOEXEC;
|
error = -ENOEXEC;
|
||||||
|
@ -332,12 +333,14 @@ Task* Task::createUserTask(const String& path, uid_t uid, gid_t gid, pid_t paren
|
||||||
t->m_tss.eip = (dword)space.symbolPtr("_start");
|
t->m_tss.eip = (dword)space.symbolPtr("_start");
|
||||||
if (!t->m_tss.eip) {
|
if (!t->m_tss.eip) {
|
||||||
// FIXME: This is ugly. If we need to do this, it should be at a different level.
|
// FIXME: This is ugly. If we need to do this, it should be at a different level.
|
||||||
MM.remove_kernel_alias_for_region(*region, region_alias);
|
if (region)
|
||||||
|
MM.remove_kernel_alias_for_region(*region, region_alias);
|
||||||
delete t;
|
delete t;
|
||||||
error = -ENOEXEC;
|
error = -ENOEXEC;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ASSERT(region);
|
||||||
MM.remove_kernel_alias_for_region(*region, region_alias);
|
MM.remove_kernel_alias_for_region(*region, region_alias);
|
||||||
|
|
||||||
MM.mapRegionsForTask(*t);
|
MM.mapRegionsForTask(*t);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue