X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fuprobe.cpp;h=c6a2d9429090f3ce2141f0fbdd66ecc51272ff75;hb=a9cfc0f36bf8ade64df08392b03a9f15409dc01b;hp=7a119ae61dea32fc4999f45cdba159cfa134c1fe;hpb=48a4000561343808724f7cb5fa8c131877489ccd;p=lttng-tools.git diff --git a/src/bin/lttng/uprobe.cpp b/src/bin/lttng/uprobe.cpp index 7a119ae61..c6a2d9429 100644 --- a/src/bin/lttng/uprobe.cpp +++ b/src/bin/lttng/uprobe.cpp @@ -5,18 +5,19 @@ * */ -#include "uprobe.h" +#include "uprobe.hpp" #include #include #include -#include "common/compat/getenv.h" -#include "common/string-utils/string-utils.h" -#include "common/utils.h" +#include "common/compat/getenv.hpp" +#include "common/string-utils/string-utils.hpp" +#include "common/utils.hpp" +#include "common/path.hpp" #include "lttng/constant.h" -#include "command.h" +#include "command.hpp" /* * Walk the directories in the PATH environment variable to find the target @@ -57,7 +58,7 @@ int walk_command_search_path(const char *binary, char *binary_full_path) * This char array is used to concatenate path to binary to look for * the binary. */ - tentative_binary_path = (char *) zmalloc(LTTNG_PATH_MAX * sizeof(char)); + tentative_binary_path = calloc(LTTNG_PATH_MAX); if (!tentative_binary_path) { ret = -1; goto alloc_error; @@ -291,7 +292,7 @@ int parse_userspace_probe_opts(const char *opt, */ if (strchr(unescaped_target_path, '/') == NULL) { /* Walk the $PATH variable to find the targeted binary. */ - real_target_path = (char *) zmalloc(LTTNG_PATH_MAX * sizeof(char)); + real_target_path = calloc(LTTNG_PATH_MAX); if (!real_target_path) { PERROR("Error allocating path buffer"); ret = CMD_ERROR;