-/* $OpenBSD: cmd-display-menu.c,v 1.39 2023/03/15 19:23:22 nicm Exp $ */
+/* $OpenBSD: cmd-display-menu.c,v 1.40 2023/08/07 10:52:00 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
else
title = xstrdup("");
menu = menu_create(title);
+ free(title);
for (i = 0; i != count; /* nothing */) {
name = args_string(args, i++);
if (count - i < 2) {
cmdq_error(item, "not enough arguments");
- free(title);
menu_free(menu);
return (CMD_RETURN_ERROR);
}
menu_add_item(menu, &menu_item, item, tc, target);
}
- free(title);
if (menu == NULL) {
cmdq_error(item, "invalid menu arguments");
return (CMD_RETURN_ERROR);