X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmodprobe.cpp;fp=src%2Fbin%2Flttng-sessiond%2Fmodprobe.cpp;h=90ed3ff14479b43a9dcdbf43ad5440358d311923;hp=0dc123de156eb23247d8196eb0971493b3a99b1a;hb=64803277bbdbe0a943360d918298a48157d9da55;hpb=60f1b42d6280b6bd386abb726dca4fd3b31d8491 diff --git a/src/bin/lttng-sessiond/modprobe.cpp b/src/bin/lttng-sessiond/modprobe.cpp index 0dc123de1..90ed3ff14 100644 --- a/src/bin/lttng-sessiond/modprobe.cpp +++ b/src/bin/lttng-sessiond/modprobe.cpp @@ -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;