Fix: event: format specifier for ssize_t
[lttng-tools.git] / src / common / event.cpp
index c3a2c0eb7203566924b0240559f3fe4bbc46a272..6dca04def6e082527338da51694af1605546787a 100644 (file)
@@ -200,6 +200,7 @@ static ssize_t lttng_event_probe_attr_create_from_payload(
        local_attr = NULL;
        ret = offset;
 end:
+       free(local_attr);
        return ret;
 }
 
@@ -261,6 +262,7 @@ static ssize_t lttng_event_function_attr_create_from_payload(
        local_attr = NULL;
        ret = offset;
 end:
+       free(local_attr);
        return ret;
 }
 
@@ -619,7 +621,7 @@ deserialize_event_type_payload:
                }
 
                if (ret != event_comm->userspace_probe_location_len) {
-                       WARN("Userspace probe location from the received buffer is not the advertised length: header length = %" PRIu32 ", payload length = %lu", event_comm->userspace_probe_location_len, ret);
+                       WARN("Userspace probe location from the received buffer is not the advertised length: header length = %" PRIu32 ", payload length = %zd", event_comm->userspace_probe_location_len, ret);
                        ret = -1;
                        goto end;
                }
@@ -1145,7 +1147,8 @@ static int lttng_event_context_app_serialize(
        }
 
        /* Include the null terminator. */
-       comm.provider_name_len = provider_len + 1;
+       provider_len += 1;
+       comm.provider_name_len = provider_len;
 
        ctx_len = strlen(ctx_name);
        if (ctx_len == 0) {
@@ -1154,7 +1157,8 @@ static int lttng_event_context_app_serialize(
        }
 
        /* Include the null terminator. */
-       comm.ctx_name_len = ctx_len + 1;
+       ctx_len += 1;
+       comm.ctx_name_len = ctx_len;
 
        /* Header */
        ret = lttng_dynamic_buffer_append(&payload->buffer, &comm,
This page took 0.024503 seconds and 4 git commands to generate.