Fix return value and mem leak for all commands
[lttng-tools.git] / src / bin / lttng / commands / add_context.c
index ce65024f5f6b912cbf2406d8be8e82018c2b9e90..a1d776d6cbb46da28b4128fd8d2d5fcacb27bf92 100644 (file)
@@ -466,7 +466,6 @@ int cmd_add_context(int argc, const char **argv)
                switch (opt) {
                case OPT_HELP:
                        usage(stdout);
-                       ret = CMD_SUCCESS;
                        goto end;
                case OPT_TYPE:
                        /*
@@ -505,7 +504,6 @@ int cmd_add_context(int argc, const char **argv)
                        break;
                case OPT_LIST_OPTIONS:
                        list_cmd_options(stdout, long_options);
-                       ret = CMD_SUCCESS;
                        goto end;
                default:
                        usage(stderr);
@@ -532,5 +530,6 @@ end:
                free(type);
        }
 
+       poptFreeContext(pc);
        return ret;
 }
This page took 0.023271 seconds and 4 git commands to generate.