X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=53a72d9b8d9129e04faac25ab84d81f214d2babd;hp=4ae8a1a35a1ba57d4b2b7e6c364ddff61efe9cb2;hb=47e52862a8330d41800736a69de93cec9287cc9d;hpb=d9f484bc6f074842bc4ac3eab0127fe3aaa10909 diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 4ae8a1a35..53a72d9b8 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -490,7 +490,7 @@ static int list_lttng_agent_events(struct agent *agt, int i = 0, ret = 0; unsigned int nb_event = 0; struct agent_event *event; - struct lttng_event *tmp_events; + struct lttng_event *tmp_events = NULL; struct lttng_ht_iter iter; size_t extended_len = 0; void *extended_at; @@ -562,9 +562,12 @@ static int list_lttng_agent_events(struct agent *agt, ret = nb_event; assert(nb_event == i); -error: +end: rcu_read_unlock(); return ret; +error: + free(tmp_events); + goto end; } /*