Fix: missing strdup oom check in lttng create.c
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index a95f269d0a93d59220c45075f140b211359b34d0..0a7f56827c0f6c741e6b1fb164b4b1a7bab129a7 100644 (file)
@@ -3315,7 +3315,7 @@ skip_domain:
        case LTTNG_LIST_CHANNELS:
        {
                int nb_chan;
-               struct lttng_channel *channels;
+               struct lttng_channel *channels = NULL;
 
                nb_chan = cmd_list_channels(cmd_ctx->lsm->domain.type,
                                cmd_ctx->session, &channels);
@@ -4672,6 +4672,10 @@ int main(int argc, char **argv)
 
        if (is_root) {
                rundir = strdup(DEFAULT_LTTNG_RUNDIR);
+               if (!rundir) {
+                       ret = -ENOMEM;
+                       goto error;
+               }
 
                /* Create global run dir with root access */
                ret = create_lttng_rundir(rundir);
This page took 0.024462 seconds and 4 git commands to generate.