Fix: uprobe: missing error code on allocation failure
[lttng-tools.git] / src / common / userspace-probe.c
index e764d137b9f3b8c8c7b973a1a3787c84986ccc9e..169bc99debb6bef714faa75ebd0957e6daff888b 100644 (file)
@@ -276,6 +276,7 @@ lttng_userspace_probe_location_tracepoint_create_no_check(const char *binary_pat
 error:
        free(probe_name_copy);
        free(provider_name_copy);
+       free(binary_path_copy);
        if (binary_fd >= 0) {
                if (close(binary_fd)) {
                        PERROR("Error closing binary fd in error path");
@@ -1105,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;
        }
 
This page took 0.023525 seconds and 4 git commands to generate.