From a633498e0bc7d15edb8fd24b595ff8d32aa50a12 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marcel=20R=C3=B6thke?= Date: Tue, 24 Mar 2020 14:36:04 +0100 Subject: [PATCH] bgpd: preinitialize rtrlib tr structures MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The tr_*_config structs were previously not pre initialized because every field is initialized explicitly. But future rtrlib version will introduce additional fields. Preinitialising the entire struct will ensure forward compatibility. Signed-off-by: Marcel Röthke --- bgpd/bgp_rpki.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c index 1ba07e95e6..be1df08ad2 100644 --- a/bgpd/bgp_rpki.c +++ b/bgpd/bgp_rpki.c @@ -811,7 +811,7 @@ static int add_tcp_cache(const char *host, const char *port, { struct rtr_socket *rtr_socket; struct tr_tcp_config *tcp_config = - XMALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_tcp_config)); + XCALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_tcp_config)); struct tr_socket *tr_socket = XMALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_socket)); struct cache *cache = @@ -845,7 +845,7 @@ static int add_ssh_cache(const char *host, const unsigned int port, const uint8_t preference) { struct tr_ssh_config *ssh_config = - XMALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_ssh_config)); + XCALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_ssh_config)); struct cache *cache = XMALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct cache)); struct tr_socket *tr_socket = -- 2.39.5