X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmodprobe.cpp;h=90ed3ff14479b43a9dcdbf43ad5440358d311923;hb=f149493493fbd8a3efa4748832c03278c96c38ca;hp=782dcc6b2714d334b0397cdee548abd0d83642a9;hpb=1c9a0b0e83c7e073c4e576c0bed95de335b0e502;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/modprobe.cpp b/src/bin/lttng-sessiond/modprobe.cpp index 782dcc6b2..90ed3ff14 100644 --- a/src/bin/lttng-sessiond/modprobe.cpp +++ b/src/bin/lttng-sessiond/modprobe.cpp @@ -18,12 +18,12 @@ #include #include -#include -#include +#include +#include -#include "modprobe.h" -#include "kern-modules.h" -#include "lttng-sessiond.h" +#include "modprobe.hpp" +#include "kern-modules.hpp" +#include "lttng-sessiond.hpp" /* LTTng kernel tracer mandatory core modules list */ struct kern_modules_param kern_modules_control_core[] = { @@ -666,7 +666,7 @@ static int grow_probes(void) /* Initialize capacity to 1 if 0. */ if (probes_capacity == 0) { - probes = (kern_modules_param *) zmalloc(sizeof(*probes)); + probes = zmalloc(); if (!probes) { PERROR("malloc probe list"); return -ENOMEM; @@ -679,7 +679,7 @@ static int grow_probes(void) /* Double size. */ probes_capacity *= 2; - tmp_probes = (kern_modules_param *) zmalloc(sizeof(*tmp_probes) * probes_capacity); + tmp_probes = calloc(probes_capacity); if (!tmp_probes) { PERROR("malloc probe list"); return -ENOMEM; @@ -741,7 +741,7 @@ static int append_list_to_probes(const char *list) name_len = strlen(next) + 13; cur_mod = &probes[nr_probes]; - cur_mod->name = (char *) zmalloc(name_len); + cur_mod->name = calloc(name_len); if (!cur_mod->name) { PERROR("malloc probe list"); ret = -ENOMEM; @@ -792,7 +792,7 @@ int modprobe_lttng_data(void) /* Default probes. */ int def_len = ARRAY_SIZE(kern_modules_probes_default); - probes = (kern_modules_param *) zmalloc(sizeof(*probes) * def_len); + probes = calloc(def_len); if (!probes) { PERROR("malloc probe list"); return -ENOMEM;