Commit 56f2e28
committed
fixup! unix-socket: avoid leak when initialization fails
This downstream fix changed `return -1` to `goto fail` in
`unix_stream_connect()` so that `unix_sockaddr_cleanup()` would run
even when `unix_sockaddr_init()` failed, avoiding a memory leak of
`ctx->orig_dir`.
Upstream fixed the same leak more surgically in c5fe29f
(unix-socket: fix memory leak when chdir(3p) fails, 2025-01-30) by
having `unix_sockaddr_init()` itself call `FREE_AND_NULL()` on
`ctx->orig_dir` before returning -1. With that fix in v2.54.0, the
caller's `goto fail` path would only call `unix_sockaddr_cleanup()`
as a no-op (since `orig_dir` is already NULL), making the downstream
patch redundant.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>1 parent 39ba52a commit 56f2e28
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
0 commit comments