doc: Specify that string memory must be freed
authorErica Bugden <ebugden@efficios.com>
Thu, 4 Jul 2024 19:26:16 +0000 (15:26 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 21 Oct 2024 18:56:30 +0000 (14:56 -0400)
commitc38ec0db1dc0412b7efeccca9aaf45075a24d456
tree2ad4b8dc15ecab8864c4f4a845ae63cb7a004298
parent25e301be1a087831ccf7e6652a25a695011b03e2
doc: Specify that string memory must be freed

Specify that the caller of `get_session_name()` must explicitly free the
memory associated with the returned string.

Historically this software was written in C. C programmers have the
reflex to assume they are responsible for freeing memory. However, now
that this project is mixed C/C++ and is transitioning towards C++ the
assumption that developers will automatically know to free memory
(according to C programming conventions) does not hold as well. For this
reason, clarify that memory must be explicitly freed by the function
caller.

There are other C functions in this software that return variables that
must explicitly be freed by the caller. However, these changes have not
been applied consistently to all these cases. The assumption is that
this individual clarification still reduces confusion even if not
applied consistently.

Change-Id: I72d3568b5c1a7d8b7ff9b3d241bca1c5c55e47c1
Signed-off-by: Erica Bugden <ebugden@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/utils.cpp
This page took 0.025473 seconds and 4 git commands to generate.