mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-20 00:10:41 -05:00
BUG/MINOR: backend: check srv_conn before dereferencing it
Commit 3c4e19f42 ("BUG/MEDIUM: backend: always release the previous
connection into its own target srv_list") introduced a valid warning
about a null-deref risk since we didn't check conn_new()'s return value.
This patch must be backported to 1.9 with the patch above.
This commit is contained in:
parent
9c4f08ae39
commit
1da41ecf5b
1 changed files with 2 additions and 1 deletions
|
|
@ -1343,7 +1343,8 @@ int connect_server(struct stream *s)
|
|||
/* no reuse or failed to reuse the connection above, pick a new one */
|
||||
if (!srv_conn) {
|
||||
srv_conn = conn_new();
|
||||
srv_conn->target = s->target;
|
||||
if (srv_conn)
|
||||
srv_conn->target = s->target;
|
||||
srv_cs = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue