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.12.2~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ded5877bea77c2ec3c95e5ec91dc52ba434cdf13;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 508c9e8d4..16c879df2 100644 --- a/src/common/userspace-probe.c +++ b/src/common/userspace-probe.c @@ -1096,12 +1096,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; }