Moved release of lock to fix use after free
This commit is contained in:
parent
f3596d96c2
commit
14448eb1bd
|
@ -99,6 +99,7 @@ static void add_group_signal_fd(rktio_signal_handle_t *signal_fd);
|
||||||
static void remove_group_signal_fd(rktio_signal_handle_t *signal_fd);
|
static void remove_group_signal_fd(rktio_signal_handle_t *signal_fd);
|
||||||
static void do_group_signal_fds();
|
static void do_group_signal_fds();
|
||||||
static int centralized_get_child_status(int pid, int in_group, int can_check_group, int *status);
|
static int centralized_get_child_status(int pid, int in_group, int can_check_group, int *status);
|
||||||
|
static int raw_get_child_status(int pid, int *status, int done_only, int do_remove, int do_free);
|
||||||
|
|
||||||
static void add_child_status(int pid, int status)
|
static void add_child_status(int pid, int status)
|
||||||
{
|
{
|
||||||
|
@ -129,12 +130,13 @@ static void add_child_status(int pid, int status)
|
||||||
if (st->signal_fd && st->in_group)
|
if (st->signal_fd && st->in_group)
|
||||||
remove_group_signal_fd(st->signal_fd);
|
remove_group_signal_fd(st->signal_fd);
|
||||||
|
|
||||||
pthread_mutex_unlock(&child_status_lock);
|
|
||||||
|
|
||||||
if (st->signal_fd)
|
if (st->signal_fd)
|
||||||
rktio_signal_received_at(st->signal_fd);
|
rktio_signal_received_at(st->signal_fd);
|
||||||
if (st->unneeded)
|
if (st->unneeded)
|
||||||
(void)centralized_get_child_status(st->pid, 0, 0, NULL);
|
(void)raw_get_child_status(st->pid, NULL, 1, 1, 1);
|
||||||
|
|
||||||
|
pthread_mutex_unlock(&child_status_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int raw_get_child_status(int pid, int *status, int done_only, int do_remove, int do_free)
|
static int raw_get_child_status(int pid, int *status, int done_only, int do_remove, int do_free)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user