diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2021-09-15 09:23:01 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2021-09-15 09:23:01 -0400 |
commit | ea1aa067aeaf41db8e463eb95d64ebdac6002851 (patch) | |
tree | 73b70a5e8d25cf8ca3f139a3edabf5679dfe5466 /spawn.c | |
parent | 353bf701d397565b22355c970c0cf76601c20fc8 (diff) | |
download | bfs-ea1aa067aeaf41db8e463eb95d64ebdac6002851.tar.xz |
spawn: Plug some leaks on error paths
Diffstat (limited to 'spawn.c')
-rw-r--r-- | spawn.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -220,6 +220,7 @@ pid_t bfs_spawn(const char *exe, const struct bfs_spawn *ctx, char **argv, char // Use a pipe to report errors from the child int pipefd[2]; if (pipe_cloexec(pipefd) != 0) { + free(resolved); return -1; } @@ -230,6 +231,7 @@ pid_t bfs_spawn(const char *exe, const struct bfs_spawn *ctx, char **argv, char error = errno; close(pipefd[1]); close(pipefd[0]); + free(resolved); errno = error; return -1; } else if (pid == 0) { |