BUG/MEDIUM: peers: prevent unitialized multiple listeners on peers section

The previous fix:
BUG/MEDIUM: peers: fix segfault using multiple bind on peers

Prevents to declare multiple listeners on a peers sections but if
peers protocol is extended to support this we could raise the bug
again.

Indeed, after allocating a new listener and adding it to a list the
code mistakenly re-configure the first element of the list instead
of the new added one, and the last one remains finally uninitialized.
The previous fix assure there is no more than one listener in this
list but this could be changed in futur.

This patch patch assures we configure and initialize the newly added
listener instead of the first one in the list.

This patch could be backported until version 2.0 to complete
BUG/MEDIUM: peers: fix segfault using multiple bind on peers

(cherry picked from commit ca82578fe82bc8fadec675efc60b56e2cea4feaf)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit b953cb0c1db757258539eca6f85030375f4f434f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed