bugfix: variable was on the stack

Guess what happens when we return from the function...
This commit is contained in:
Cedric Roux
2017-02-15 15:38:37 +01:00
parent f52a42eda5
commit 7b36af0597
2 changed files with 7 additions and 3 deletions
+3
View File
@@ -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) {
+4 -3
View File
@@ -85,9 +85,10 @@ int create_tasks(uint32_t enb_nb, uint32_t ue_nb)
# if defined(NAS_BUILT_IN_UE)
if (ue_nb > 0) {
nas_user_container_t users;
users.count = ue_nb;
if (itti_create_task (TASK_NAS_UE, nas_ue_task, &users) < 0) {
nas_user_container_t *users = calloc(1, sizeof(*users));
if (users == NULL) abort();
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");
return -1;
}