aboutsummaryrefslogtreecommitdiff
path: root/src/shell.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2023-05-06 14:32:29 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2023-05-06 14:32:29 +0200
commit8cf0d9d94b91d036d44fa02ebe5f6acea594a6d8 (patch)
tree98b6a84ad54b2f9b8d51bfc6db465f65d2b9cdb2 /src/shell.c
parent6cbd6f165ce3f063c5f940e38dd9a2132106a9ee (diff)
downloadnissy-classic-8cf0d9d94b91d036d44fa02ebe5f6acea594a6d8.tar.gz
nissy-classic-8cf0d9d94b91d036d44fa02ebe5f6acea594a6d8.zip
Added sanitizers for debug compile, fixed memory leak
Diffstat (limited to '')
-rw-r--r--src/shell.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shell.c b/src/shell.c
index 9c3173b..3c19a31 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -64,13 +64,13 @@ exec_args(int c, char **v)
64 64
65 if (cmd == NULL) { 65 if (cmd == NULL) {
66 fprintf(stderr, "%s: command not found\n", v[0]); 66 fprintf(stderr, "%s: command not found\n", v[0]);
67 return; 67 goto exec_args_end;
68 } 68 }
69 69
70 args = cmd->parse_args(c-1, &v[1]); 70 args = cmd->parse_args(c-1, &v[1]);
71 if (!args->success) { 71 if (!args->success) {
72 fprintf(stderr, "usage: %s\n", cmd->usage); 72 fprintf(stderr, "usage: %s\n", cmd->usage);
73 return; 73 goto exec_args_end;
74 } 74 }
75 75
76 if (args->scrstdin) { 76 if (args->scrstdin) {
@@ -94,6 +94,8 @@ exec_args(int c, char **v)
94 } else { 94 } else {
95 cmd->exec(args); 95 cmd->exec(args);
96 } 96 }
97
98exec_args_end:
97 free_args(args); 99 free_args(args);
98} 100}
99 101

Generated with cgit - Back to sebastiano.tronto.net