Fix: sessiond: fix memory leak in receive_lttng_trigger
[lttng-tools.git] / src / bin / lttng-sessiond / utils.c
index febf2305826a5ce31c7033e111457aae5040618c..e806082e324678c026a5e112ac7b2d3e28ccc272 100644 (file)
@@ -16,7 +16,7 @@
 #include "snapshot.h"
 #include "lttng-sessiond.h"
 
-int ht_cleanup_pipe[2] = { -1, -1 };
+int the_ht_cleanup_pipe[2] = {-1, -1};
 
 /*
  * Write to writable pipe used to notify a thread.
@@ -41,7 +41,7 @@ int notify_thread_pipe(int wpipe)
 void ht_cleanup_push(struct lttng_ht *ht)
 {
        ssize_t ret;
-       int fd = ht_cleanup_pipe[1];
+       int fd = the_ht_cleanup_pipe[1];
 
        if (!ht) {
                return;
@@ -98,26 +98,3 @@ const char *consumer_output_get_base_path(const struct consumer_output *output)
                        output->dst.session_root_path :
                        output->dst.net.base_dir;
 }
-
-/*
- * Allocate a filter and copy the given original filter.
- *
- * Return allocated filter or NULL on error.
- */
-struct lttng_filter_bytecode *lttng_filter_bytecode_copy(
-               const struct lttng_filter_bytecode *orig_f)
-{
-       struct lttng_filter_bytecode *filter = NULL;
-
-       /* Copy filter bytecode */
-       filter = zmalloc(sizeof(*filter) + orig_f->len);
-       if (!filter) {
-               PERROR("zmalloc alloc filter bytecode");
-               goto error;
-       }
-
-       memcpy(filter, orig_f, sizeof(*filter) + orig_f->len);
-
-error:
-       return filter;
-}
This page took 0.02356 seconds and 4 git commands to generate.