From: Jérémie Galarneau Date: Wed, 22 Jul 2020 20:43:26 +0000 (-0400) Subject: payload: don't re-initialize destination payload on copy X-Git-Tag: v2.13.0-rc1~565 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=38f2de9d8209cd72db7aa37f274be287a654d8db;p=lttng-tools.git payload: don't re-initialize destination payload on copy This makes it possible to re-use the same destination payload and not always re-allocate memory for its underlying arrays. Signed-off-by: Jérémie Galarneau Change-Id: I959b2e8851a81034b681d7188c504752620e1b50 --- diff --git a/src/common/payload.c b/src/common/payload.c index 635d3e3fb..c4faece18 100644 --- a/src/common/payload.c +++ b/src/common/payload.c @@ -25,7 +25,6 @@ int lttng_payload_copy(const struct lttng_payload *src_payload, int ret; size_t i; - lttng_payload_init(dst_payload); ret = lttng_dynamic_buffer_append_buffer( &dst_payload->buffer, &src_payload->buffer); if (ret) { @@ -60,7 +59,6 @@ int lttng_payload_copy(const struct lttng_payload *src_payload, end: return ret; error: - lttng_payload_reset(dst_payload); goto end; }