Fix: uprobe: missing error code on allocation failure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 15 Jun 2020 22:44:23 +0000 (18:44 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 27 Jul 2020 20:30:38 +0000 (16:30 -0400)
lttng_userspace_probe_location_function_create_from_payload
does not report an allocation failure when strdup fails.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ibed9906cabeca81081647d220a7aef1f54d251d4

src/common/userspace-probe.c

index fe11e3b5018c26d6136067e84bd1d7f7185ee17f..8c6adaca620b62d6fb7a47a94cbf67bffb051d7f 100644 (file)
@@ -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;
        }
 
This page took 0.026216 seconds and 4 git commands to generate.