From: Alan T. DeKok Date: Fri, 2 Nov 2018 14:27:07 +0000 (-0400) Subject: build fixes for capabilities X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=07589af71377eebd953cfd93f06bc1d97d9b9cee;p=thirdparty%2Ffreeradius-server.git build fixes for capabilities --- diff --git a/src/lib/util/socket.c b/src/lib/util/socket.c index db82a10c883..c335810a8c6 100644 --- a/src/lib/util/socket.c +++ b/src/lib/util/socket.c @@ -874,7 +874,7 @@ int fr_socket_bind(int sockfd, fr_ipaddr_t const *src_ipaddr, uint16_t *src_port if (src_port) my_port = *src_port; #ifdef HAVE_CAPABILITY_H - if (*src_port < 1024) { /* Super special service ports */ + if (src_port && (*src_port < 1024)) { /* Super special service ports */ cap_t caps; cap_flag_value_t state; @@ -928,9 +928,10 @@ int fr_socket_bind(int sockfd, fr_ipaddr_t const *src_ipaddr, uint16_t *src_port goto skip_cap; } } - } + skip_cap: - if (caps) cap_free(caps); + if (caps) cap_free(caps); + } #endif /*