Clean-up: Remove double buffer initialisation
authorYannick Lamarre <ylamarre@efficios.com>
Thu, 28 Mar 2019 19:07:43 +0000 (15:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 25 Apr 2019 18:21:30 +0000 (14:21 -0400)
Signed-off-by: Yannick Lamarre <ylamarre@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/lttng-ctl.c

index bbff088e098107ebd64b171116f767a1f7126079..f50ca306145f9b30e28b24f3bfea500f9181f1f4 100644 (file)
@@ -1078,7 +1078,11 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle,
        unsigned int free_filter_expression = 0;
        struct filter_parser_ctx *ctx = NULL;
 
-       memset(&send_buffer, 0, sizeof(send_buffer));
+       /*
+        * We have either a filter or some exclusions, so we need to set up
+        * a variable-length memory block from where to send the data.
+        */
+       lttng_dynamic_buffer_init(&send_buffer);
 
        /*
         * Cast as non-const since we may replace the filter expression
@@ -1128,12 +1132,6 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle,
        lsm.u.enable.exclusion_count = exclusion_count;
        lsm.u.enable.bytecode_len = 0;
 
-       /*
-        * We have either a filter or some exclusions, so we need to set up
-        * a variable-length memory block from where to send the data.
-        */
-       lttng_dynamic_buffer_init(&send_buffer);
-
        /* Parse filter expression. */
        if (filter_expression != NULL || handle->domain.type == LTTNG_DOMAIN_JUL
                        || handle->domain.type == LTTNG_DOMAIN_LOG4J
This page took 0.025795 seconds and 4 git commands to generate.