diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-26 23:00:55 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-26 23:00:55 +0300 |
| commit | 3f194f1c7264945a63b0018b159cc83bd9385c59 (patch) | |
| tree | 4d277264e75b197844eae154e96e73d9cd54de3a /src/uapi | |
| parent | 1b5a553194f47066d60bb1c9475af1f413af8f4a (diff) | |
| download | kmi-3f194f1c7264945a63b0018b159cc83bd9385c59.tar.gz kmi-3f194f1c7264945a63b0018b159cc83bd9385c59.zip | |
fix memory leaks destroying threads
Diffstat (limited to 'src/uapi')
| -rw-r--r-- | src/uapi/proc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/uapi/proc.c b/src/uapi/proc.c index a99acb5..b010220 100644 --- a/src/uapi/proc.c +++ b/src/uapi/proc.c @@ -41,7 +41,11 @@ SYSCALL_DEFINE5(create)(struct tcb *t, sys_arg_t func, /** @todo there's quite a bit of overlap between this and what * core_bringup() is doing, might separate this out into its own * function? */ - alloc_stack(c); + if (alloc_stack(c)) { + destroy_thread(c); + return_args1(t, ERR_OOMEM); + } + set_thread(c); set_ret5(c, c->tid, d0, d1, d2, d3); |
