projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: leak on agent event listing error
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.c
diff --git
a/src/bin/lttng-sessiond/cmd.c
b/src/bin/lttng-sessiond/cmd.c
index 4ae8a1a35a1ba57d4b2b7e6c364ddff61efe9cb2..53a72d9b8d9129e04faac25ab84d81f214d2babd 100644
(file)
--- 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;
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;
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);
ret = nb_event;
assert(nb_event == i);
-e
rror
:
+e
nd
:
rcu_read_unlock();
return ret;
rcu_read_unlock();
return ret;
+error:
+ free(tmp_events);
+ goto end;
}
/*
}
/*
This page took
0.023463 seconds
and
4
git commands to generate.