cmd_assign: fix leak on error

Found through static analysis.
This commit is contained in:
Dominique Martinet 2018-07-01 23:17:28 +09:00
parent 971b2f11f9
commit e67c8cf1cb

View File

@ -27,6 +27,7 @@ struct cmd_results *cmd_assign(int argc, char **argv) {
if (strncmp(*argv, "", strlen("")) == 0) { if (strncmp(*argv, "", strlen("")) == 0) {
if (argc < 3) { if (argc < 3) {
free(criteria);
return cmd_results_new(CMD_INVALID, "assign", "Missing workspace"); return cmd_results_new(CMD_INVALID, "assign", "Missing workspace");
} }
++argv; ++argv;