Project

General

Profile

Bug #1314 » 0001-Fix-ust-segfault-on-lttng-start-on-filter-bytecode-c.patch

Jonathan Rajotte Julien, 10/21/2021 04:04 PM

View differences:

src/bin/lttng-sessiond/event.c
exclusion = NULL;
if (uevent == NULL) {
ret = LTTNG_ERR_UST_ENABLE_FAIL;
goto error;
goto end;
}
/* Valid to set it after the goto error since uevent is still NULL */
......
if (ret < 0) {
if (ret == -LTTNG_UST_ERR_EXIST) {
ret = LTTNG_ERR_UST_EVENT_EXIST;
goto end;
} else {
ret = LTTNG_ERR_UST_ENABLE_FAIL;
goto error;
}
goto end;
}
if (to_create) {
......
free(filter);
free(exclusion);
return ret;
error:
/*
* Only destroy event on creation time (not enabling time) because if the
* event is found in the channel (to_create == 0), it means that at some
* point the enable_event worked and it's thus valid to keep it alive.
* Destroying it also implies that we also destroy it's shadow copy to sync
* everyone up.
*/
if (to_create) {
/* In this code path, the uevent was not added to the hash table */
trace_ust_destroy_event(uevent);
}
rcu_read_unlock();
free(filter_expression);
free(filter);
free(exclusion);
return ret;
}
/*
(7-7/9)