Commit 816d96ba authored by Cedric Roux's avatar Cedric Roux

bugfix: variable was on the stack

Guess what happens when we return from the function...
parent bb041379
...@@ -271,6 +271,9 @@ void *nas_ue_task(void *args_p) ...@@ -271,6 +271,9 @@ void *nas_ue_task(void *args_p)
} }
} }
} }
free(users);
return NULL;
} }
nas_user_t *find_user_from_fd(nas_user_container_t *users, int fd) { nas_user_t *find_user_from_fd(nas_user_container_t *users, int fd) {
......
...@@ -85,9 +85,10 @@ int create_tasks(uint32_t enb_nb, uint32_t ue_nb) ...@@ -85,9 +85,10 @@ int create_tasks(uint32_t enb_nb, uint32_t ue_nb)
# if defined(NAS_BUILT_IN_UE) # if defined(NAS_BUILT_IN_UE)
if (ue_nb > 0) { if (ue_nb > 0) {
nas_user_container_t users; nas_user_container_t *users = calloc(1, sizeof(*users));
users.count = ue_nb; if (users == NULL) abort();
if (itti_create_task (TASK_NAS_UE, nas_ue_task, &users) < 0) { users->count = ue_nb;
if (itti_create_task (TASK_NAS_UE, nas_ue_task, users) < 0) {
LOG_E(NAS, "Create task for NAS UE failed\n"); LOG_E(NAS, "Create task for NAS UE failed\n");
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment