Tests: fix: lttng-create: leaked command parameter
[lttng-tools.git] / src / bin / lttng / commands / create.c
index 2b44dd63a07c7da94c77c57367cf9ddf42d5f715..705605c92826e3b214eaf2e05c47f449d418445b 100644 (file)
@@ -674,6 +674,11 @@ int cmd_create(int argc, const char **argv)
                        uint64_t v;
 
                        errno = 0;
+                       if (opt_arg) {
+                               free(opt_arg);
+                               opt_arg = NULL;
+                       }
+
                        opt_arg = poptGetOptArg(pc);
                        if (!opt_arg) {
                                /* Set up default values. */
@@ -804,6 +809,7 @@ end:
        /* Overwrite ret if an error occurred in create_session() */
        ret = command_ret ? command_ret : ret;
 
+       free(opt_arg);
        poptFreeContext(pc);
        return ret;
 }
This page took 0.023175 seconds and 4 git commands to generate.