Bug #1381 ยป avoid-assert-list-triggers.patch
src/common/actions/path.c | ||
---|---|---|
int lttng_action_path_copy(const struct lttng_action_path *src,
|
||
struct lttng_action_path **dst)
|
||
{
|
||
int ret;
|
||
int ret = 0;
|
||
struct lttng_action_path *new_path;
|
||
size_t src_count = 0;
|
||
assert(src);
|
||
assert(dst);
|
||
new_path = lttng_action_path_create(
|
||
src_count = lttng_dynamic_array_get_count(&src->indexes);
|
||
if (src_count > 0) {
|
||
new_path = lttng_action_path_create(
|
||
(uint64_t *) lttng_dynamic_array_get_element(
|
||
&src->indexes, 0),
|
||
lttng_dynamic_array_get_count(&src->indexes));
|
||
if (!new_path) {
|
||
ret = -1;
|
||
} else {
|
||
ret = 0;
|
||
*dst = new_path;
|
||
}
|
||
if (!new_path) {
|
||
ret = -1;
|
||
} else {
|
||
ret = 0;
|
||
*dst = new_path;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
*dst = lttng_action_path_create(NULL, 0);
|
||
ret = 0;
|
||
}
|
||
return ret;
|
||
}
|