X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fuprobe.cpp;fp=src%2Fbin%2Flttng%2Fuprobe.cpp;h=c6a2d9429090f3ce2141f0fbdd66ecc51272ff75;hp=07ac5d5fa5ab6d9d30fadf31f8492455f9f689b8;hb=64803277bbdbe0a943360d918298a48157d9da55;hpb=60f1b42d6280b6bd386abb726dca4fd3b31d8491 diff --git a/src/bin/lttng/uprobe.cpp b/src/bin/lttng/uprobe.cpp index 07ac5d5fa..c6a2d9429 100644 --- a/src/bin/lttng/uprobe.cpp +++ b/src/bin/lttng/uprobe.cpp @@ -58,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; @@ -292,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;