From 2aa28610e2bff8b40ad2810cbf0c7ea3b79e106d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 15 Jun 2020 18:44:23 -0400 Subject: [PATCH] Fix: uprobe: missing error code on allocation failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/userspace-probe.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.34.1