Fix: mark channel as disabled even if the session is inactive
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 05566d5f86fdb6494e8069bdafc7c03cbc05733a..1174162aa9ac8df25b4dcfc23994a95ac09e50bb 100644 (file)
@@ -856,7 +856,7 @@ static int set_options(int argc, char **argv)
        int ret = 0, c = 0, option_index = 0;
        int orig_optopt = optopt, orig_optind = optind;
        char *optstring;
-       const char *config_path = NULL;
+       char *config_path = NULL;
 
        optstring = utils_generate_optstring(long_options,
                        sizeof(long_options) / sizeof(struct option));
@@ -880,6 +880,7 @@ static int set_options(int argc, char **argv)
                        WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.",
                                "-f, --config");
                } else {
+                       free(config_path);
                        config_path = utils_expand_path(optarg);
                        if (!config_path) {
                                ERR("Failed to resolve path: %s", optarg);
@@ -925,6 +926,7 @@ static int set_options(int argc, char **argv)
        }
 
 end:
+       free(config_path);
        free(optstring);
        return ret;
 }
@@ -1331,7 +1333,7 @@ static void unregister_all_triggers(void)
        struct lttng_triggers *triggers = NULL;
        unsigned int trigger_count, i;
        const struct lttng_credentials creds = {
-                       .uid = LTTNG_OPTIONAL_INIT_VALUE(0),
+               .uid = LTTNG_OPTIONAL_INIT_VALUE(0),
        };
 
        DBG("Unregistering all triggers");
@@ -1363,7 +1365,8 @@ static void unregister_all_triggers(void)
                assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
 
                trigger_status = lttng_trigger_get_name(trigger, &trigger_name);
-               assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
+               trigger_name = trigger_status == LTTNG_TRIGGER_STATUS_OK ?
+                               trigger_name : "(anonymous)";
 
                DBG("Unregistering trigger: trigger owner uid = %d, trigger name = '%s'",
                                (int) trigger_owner, trigger_name);
This page took 0.023459 seconds and 4 git commands to generate.