X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fmain.c;h=548cc43095b633bb09528085dfb878a5e99578f6;hb=db322c4dcbe5bf4b8a16d8444fa7f56579c72b26;hp=4d700d1e54130fae8ae19369e8bdc8e3b7ca7771;hpb=04135dbd279d3d0de6a6527b9b933e59de5cb495;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 4d700d1e5..548cc4309 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -4199,6 +4199,10 @@ static int set_option(int opt, const char *arg, const char *optname) break; case 'g': tracing_group_name = strdup(arg); + if (!tracing_group_name) { + perror("strdup"); + ret = -ENOMEM; + } break; case 'h': usage(); @@ -4253,22 +4257,42 @@ static int set_option(int opt, const char *arg, const char *optname) break; case 'u': consumerd32_bin = strdup(arg); + if (!consumerd32_bin) { + perror("strdup"); + ret = -ENOMEM; + } consumerd32_bin_override = 1; break; case 'U': consumerd32_libdir = strdup(arg); + if (!consumerd32_libdir) { + perror("strdup"); + ret = -ENOMEM; + } consumerd32_libdir_override = 1; break; case 't': consumerd64_bin = strdup(arg); + if (!consumerd64_bin) { + perror("strdup"); + ret = -ENOMEM; + } consumerd64_bin_override = 1; break; case 'T': consumerd64_libdir = strdup(arg); + if (!consumerd64_libdir) { + perror("strdup"); + ret = -ENOMEM; + } consumerd64_libdir_override = 1; break; case 'p': opt_pidfile = strdup(arg); + if (!opt_pidfile) { + perror("strdup"); + ret = -ENOMEM; + } break; case 'J': /* JUL TCP port. */ { @@ -4297,6 +4321,10 @@ static int set_option(int opt, const char *arg, const char *optname) break; case 'P': /* probe modules list */ kmod_probes_list = strdup(arg); + if (!kmod_probes_list) { + perror("strdup"); + ret = -ENOMEM; + } break; case 'f': /* This is handled in set_options() thus silent break. */