diff options
| author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2025-04-06 18:47:07 +0200 |
|---|---|---|
| committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2025-04-07 01:32:06 +0200 |
| commit | 3490c8b4532edb60d887ebcc74319ee2018eaad1 (patch) | |
| tree | f70e9db5c09faa04763d8f848fd196725fa1d313 | |
| parent | 058bb5ddf69b999f68c5a8fa45402feda11d750d (diff) | |
openrc-run: use array instead of malloc(BUFSIZ)origin/parallel_rework_followup
| -rw-r--r-- | src/openrc-run/openrc-run.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/openrc-run/openrc-run.c b/src/openrc-run/openrc-run.c index 8aee5ce8..c97c2e0a 100644 --- a/src/openrc-run/openrc-run.c +++ b/src/openrc-run/openrc-run.c @@ -363,7 +363,7 @@ svc_exec(const char *arg1, const char *arg2) int flags = 0; struct pollfd fd[2]; int s; - char *buffer; + char buffer[BUFSIZ]; size_t bytes; bool prefixed = false; int slave_tty; @@ -428,7 +428,6 @@ svc_exec(const char *arg1, const char *arg2) /* UNREACHABLE */ } - buffer = xmalloc(sizeof(char) * BUFSIZ); fd[0].fd = signal_pipe[0]; fd[1].fd = master_tty; fd[0].events = fd[1].events = POLLIN; @@ -485,8 +484,6 @@ svc_exec(const char *arg1, const char *arg2) } } - free(buffer); - sigemptyset (&sigchldmask); sigaddset (&sigchldmask, SIGCHLD); sigprocmask (SIG_BLOCK, &sigchldmask, &oldmask); |
