Fix: Unreachable error logging in set_option()
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 3e04f963329e6603c859164f1ee4ff4207a8e118..a970012c7fde9fc90464adfd2520add2e6a3a903 100644 (file)
@@ -4464,6 +4464,7 @@ static int set_option(int opt, const char *arg, const char *optname)
                ret = -1;
        }
 
+end:
        if (ret == -EINVAL) {
                const char *opt_name = "unknown";
                int i;
@@ -4479,7 +4480,7 @@ static int set_option(int opt, const char *arg, const char *optname)
                WARN("Invalid argument provided for option \"%s\", using default value.",
                        opt_name);
        }
-end:
+
        return ret;
 }
 
@@ -5110,6 +5111,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.023355 seconds and 4 git commands to generate.