diff --git a/src/shared/shell.c b/src/shared/shell.c
index fc4c9b5..f962f21 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
if (parse_args(man, &w, "<>", flags) < 0) {
print_text(COLOR_HIGHLIGHT,
"Unable to parse mandatory command arguments: %s", man );
+ free(man);
return -EINVAL;
}
+ free(man);
+
/* Check if there are enough arguments */
if ((unsigned) argc - 1 < w.we_wordc) {
print_text(COLOR_HIGHLIGHT, "Missing %s argument",
if (parse_args(opt, &w, "[]", flags) < 0) {
print_text(COLOR_HIGHLIGHT,
"Unable to parse optional command arguments: %s", opt);
+ free(opt);
return -EINVAL;
}
+ free(opt);
+
/* Check if there are too many arguments */
if ((unsigned) argc - 1 > w.we_wordc && !w.we_offs) {
print_text(COLOR_HIGHLIGHT, "Too many arguments: %d > %zu",
return NULL;
if (!entry->arg)
- goto done;
+ goto end;
str = strdup(entry->arg);
if (!strrchr(entry->arg, '/'))
goto done;
+ free(str);
+
/* Split values separated by / */
str = strdelimit(args.we_wordv[index], "/", ' ');
matches = rl_completion_matches(text, arg_generator);
done:
+ free(str);
+end:
if (!matches && text[0] == '\0')
bt_shell_printf("Usage: %s %s\n", entry->cmd,
entry->arg ? entry->arg : "");