BUG/MINOR: backend: assign the wait list after the error check
Commit 85b73e9 ("BUG/MEDIUM: stream: Make sure polling is right on retry.")
introduced a possible null dereference on the error path detected by gcc-7.
Let's simply assign srv_conn after checking the error and not before.
No backport is needed.
diff --git a/src/backend.c b/src/backend.c
index 834caec..4d75df6 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1167,12 +1167,13 @@
LIST_DEL(&srv_conn->list);
LIST_INIT(&srv_conn->list);
}
- srv_conn->send_wait = send_wait;
- srv_conn->recv_wait = recv_wait;
if (!srv_cs)
return SF_ERR_RESOURCE;
+ srv_conn->send_wait = send_wait;
+ srv_conn->recv_wait = recv_wait;
+
if (!(s->flags & SF_ADDR_SET)) {
err = assign_server_address(s);
if (err != SRV_STATUS_OK)