aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-user/main.c2
-rw-r--r--linux-user/syscall.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 1f68766f0f..6b4d8d72c9 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2183,11 +2183,11 @@ void usage(void)
THREAD CPUState *thread_env;
+/* Assumes contents are already zeroed. */
void init_task_state(TaskState *ts)
{
int i;
- memset(ts, 0, sizeof(TaskState));
ts->used = 1;
ts->first_free = ts->sigqueue_table;
for (i = 0; i < MAX_SIGQUEUE_SIZE - 1; i++) {
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b6e9778a8f..c99c5ffe20 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2787,7 +2787,7 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp,
new_thread_info info;
pthread_attr_t attr;
#endif
- ts = malloc(sizeof(TaskState) + NEW_STACK_SIZE);
+ ts = qemu_mallocz(sizeof(TaskState) + NEW_STACK_SIZE);
init_task_state(ts);
new_stack = ts->stack;
/* we create a new CPU instance. */