From: Jérémie Galarneau Date: Mon, 15 Jun 2020 22:44:23 +0000 (-0400) Subject: Fix: uprobe: missing error code on allocation failure X-Git-Tag: v2.13.0-rc1~575 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=2aa28610e2bff8b40ad2810cbf0c7ea3b79e106d Fix: uprobe: missing error code on allocation failure lttng_userspace_probe_location_function_create_from_payload does not report an allocation failure when strdup fails. Signed-off-by: Jérémie Galarneau Change-Id: Ibed9906cabeca81081647d220a7aef1f54d251d4 --- diff --git a/src/common/userspace-probe.c b/src/common/userspace-probe.c index fe11e3b50..8c6adaca6 100644 --- a/src/common/userspace-probe.c +++ b/src/common/userspace-probe.c @@ -1217,12 +1217,14 @@ int lttng_userspace_probe_location_function_create_from_buffer( function_name = lttng_strndup(function_name_src, LTTNG_SYMBOL_NAME_LEN); if (!function_name) { PERROR("lttng_strndup"); + ret = -LTTNG_ERR_NOMEM; goto end; } binary_path = lttng_strndup(binary_path_src, LTTNG_PATH_MAX); if (!binary_path) { PERROR("lttng_strndup"); + ret = -LTTNG_ERR_NOMEM; goto end; }