Commit 6884028
af_unix: Fix memleak of newsk in unix_stream_connect().
When prepare_peercred() fails in unix_stream_connect(),
unix_release_sock() is not called for newsk, and the memory
is leaked.
Let's move prepare_peercred() before unix_create1().
Fixes: fd0a109 ("net, pidfs: prepare for handing out pidfds for reaped sk->sk_peer_pid")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260207232236.2557549-1-kuniyu@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>1 parent e3998b6 commit 6884028
1 file changed
Lines changed: 3 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1650 | 1650 | | |
1651 | 1651 | | |
1652 | 1652 | | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
1657 | 1656 | | |
1658 | 1657 | | |
1659 | 1658 | | |
| |||
1662 | 1661 | | |
1663 | 1662 | | |
1664 | 1663 | | |
1665 | | - | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
1669 | 1664 | | |
1670 | 1665 | | |
1671 | 1666 | | |
| |||
0 commit comments