mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 12:41:00 +02:00
CLEANUP: dns: Use DISGUISE() on a never-failing ring_attach() call
When a DNS session is created, the call to ring_attach() never fails. The ring is freshly initialized and there is other watcher on it. Thus, the call always succeeds. Instead of catching an error that must never happen, we use the DISGUISE() macro to make static analyzers happy.
This commit is contained in:
parent
6f69110191
commit
1a1b674c2c
@ -1028,13 +1028,8 @@ struct dns_session *dns_session_new(struct dns_stream_server *dss)
|
||||
goto error;
|
||||
|
||||
ring_init(&ds->ring, ds->tx_ring_area, DNS_TCP_MSG_RING_MAX_SIZE);
|
||||
if (!ring_attach(&ds->ring)) {
|
||||
/* Should never happen
|
||||
* since we are the first attached
|
||||
* here
|
||||
*/
|
||||
goto error;
|
||||
}
|
||||
/* never fail because it is the first watcher attached to the ring */
|
||||
DISGUISE(ring_attach(&ds->ring));
|
||||
|
||||
if ((ds->task_exp = task_new(tid_bit)) == NULL)
|
||||
goto error;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user