1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-16 16:27:40 +00:00

Shut up some warnings from clang's static analyzer.

Not particularly useful actually, by and large false positives.
This commit is contained in:
Calvin Rose
2019-02-22 12:10:27 -05:00
parent 9d60e8b343
commit 2ea28f29b0
9 changed files with 22 additions and 18 deletions

View File

@@ -125,6 +125,7 @@ static Janet os_execute(int32_t argc, Janet *argv) {
static Janet os_execute(int32_t argc, Janet *argv) {
janet_arity(argc, 1, -1);
const uint8_t **child_argv = malloc(sizeof(uint8_t *) * (argc + 1));
int status = 0;
if (NULL == child_argv) {
JANET_OUT_OF_MEMORY;
}
@@ -141,9 +142,10 @@ static Janet os_execute(int32_t argc, Janet *argv) {
if (-1 == execve((const char *)child_argv[0], (char **)child_argv, NULL)) {
exit(1);
}
} else {
waitpid(pid, &status, 0);
}
int status;
waitpid(pid, &status, 0);
free(child_argv);
return janet_wrap_integer(status);
}
#endif