Fix: leak of filter bytecode and expression on agent event re-enable
[lttng-tools.git] / src / bin / lttng-sessiond / event.c
index f97148db113c2bf1c8f3cc32dd9b6dd38170f599..b0b37bed777a4eb5b537b0739c14115b5e3020a2 100644 (file)
@@ -506,7 +506,8 @@ int event_agent_enable(struct ltt_ust_session *usess,
                        ret = LTTNG_ERR_NOMEM;
                        goto error;
                }
-
+               filter = NULL;
+               filter_expression = NULL;
                created = 1;
        }
 
@@ -533,13 +534,16 @@ int event_agent_enable(struct ltt_ust_session *usess,
                agent_add_event(aevent, agt);
        }
 
-end:
-       return LTTNG_OK;
+       ret = LTTNG_OK;
+       goto end;
 
 error:
        if (created) {
                agent_destroy_event(aevent);
        }
+end:
+       free(filter);
+       free(filter_expression);
        return ret;
 }
 
This page took 0.024459 seconds and 5 git commands to generate.