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.11.5~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a7a8030fb9681c60b965475bff669983eb3ea965;p=lttng-tools.git 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 b6e5083a2..169bc99de 100644 --- a/src/common/userspace-probe.c +++ b/src/common/userspace-probe.c @@ -1106,12 +1106,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; }