projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aa38119
)
no need to initialize result ptr of getaddrinfo
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Tue, 2 Aug 2016 14:42:23 +0000
(16:42 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Wed, 3 Aug 2016 08:05:59 +0000
(10:05 +0200)
src/daemon/common.c
patch
|
blob
|
history
src/libcollectdclient/client.c
patch
|
blob
|
history
src/libcollectdclient/network.c
patch
|
blob
|
history
src/memcached.c
patch
|
blob
|
history
src/modbus.c
patch
|
blob
|
history
src/network.c
patch
|
blob
|
history
src/olsrd.c
patch
|
blob
|
history
src/pinba.c
patch
|
blob
|
history
src/statsd.c
patch
|
blob
|
history
src/write_graphite.c
patch
|
blob
|
history
src/write_tsdb.c
patch
|
blob
|
history
diff --git
a/src/daemon/common.c
b/src/daemon/common.c
index
b3bc753
..
7bbace7
100644
(file)
--- a/
src/daemon/common.c
+++ b/
src/daemon/common.c
@@
-1524,8
+1524,6
@@
int service_name_to_port_number (const char *service_name)
if (service_name == NULL)
return (-1);
if (service_name == NULL)
return (-1);
- ai_list = NULL;
-
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC
};
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC
};
diff --git
a/src/libcollectdclient/client.c
b/src/libcollectdclient/client.c
index
fea9360
..
cd333cc
100644
(file)
--- a/
src/libcollectdclient/client.c
+++ b/
src/libcollectdclient/client.c
@@
-471,8
+471,6
@@
static int lcc_open_netsocket (lcc_connection_t *c, /* {{{ */
}
}
}
}
- ai_res = NULL;
-
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC,
.ai_flags = AI_ADDRCONFIG,
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC,
.ai_flags = AI_ADDRCONFIG,
diff --git
a/src/libcollectdclient/network.c
b/src/libcollectdclient/network.c
index
afbee6e
..
ee5af3b
100644
(file)
--- a/
src/libcollectdclient/network.c
+++ b/
src/libcollectdclient/network.c
@@
-119,7
+119,7
@@
static void int_server_destroy (lcc_server_t *srv) /* {{{ */
static int server_open_socket (lcc_server_t *srv) /* {{{ */
{
static int server_open_socket (lcc_server_t *srv) /* {{{ */
{
- struct addrinfo *ai_list
= NULL
;
+ struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
int status;
struct addrinfo *ai_ptr;
int status;
diff --git
a/src/memcached.c
b/src/memcached.c
index
c0c9e70
..
46155e7
100644
(file)
--- a/
src/memcached.c
+++ b/
src/memcached.c
@@
-108,8
+108,6
@@
static int memcached_connect_inet (memcached_t *st)
host = (st->host != NULL) ? st->host : MEMCACHED_DEF_HOST;
port = (st->port != NULL) ? st->port : MEMCACHED_DEF_PORT;
host = (st->host != NULL) ? st->host : MEMCACHED_DEF_HOST;
port = (st->port != NULL) ? st->port : MEMCACHED_DEF_PORT;
- ai_list = NULL;
-
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC,
.ai_flags = AI_ADDRCONFIG,
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC,
.ai_flags = AI_ADDRCONFIG,
diff --git
a/src/modbus.c
b/src/modbus.c
index
a215060
..
ec42969
100644
(file)
--- a/
src/modbus.c
+++ b/
src/modbus.c
@@
-823,8
+823,6
@@
static int mb_config_set_host_address (mb_host_t *host, /* {{{ */
if ((host == NULL) || (address == NULL))
return (EINVAL);
if ((host == NULL) || (address == NULL))
return (EINVAL);
- ai_list = NULL;
-
struct addrinfo ai_hints = {
/* XXX: libmodbus can only handle IPv4 addresses. */
.ai_family = AF_INET,
struct addrinfo ai_hints = {
/* XXX: libmodbus can only handle IPv4 addresses. */
.ai_family = AF_INET,
diff --git
a/src/network.c
b/src/network.c
index
11c39a7
..
4ce3f5f
100644
(file)
--- a/
src/network.c
+++ b/
src/network.c
@@
-2139,7
+2139,7
@@
static int sockent_client_connect (sockent_t *se) /* {{{ */
static c_complain_t complaint = C_COMPLAIN_INIT_STATIC;
struct sockent_client *client;
static c_complain_t complaint = C_COMPLAIN_INIT_STATIC;
struct sockent_client *client;
- struct addrinfo *ai_list
= NULL
, *ai_ptr;
+ struct addrinfo *ai_list, *ai_ptr;
int status;
_Bool reconnect = 0;
cdtime_t now;
int status;
_Bool reconnect = 0;
cdtime_t now;
diff --git
a/src/olsrd.c
b/src/olsrd.c
index
976793f
..
ac47811
100644
(file)
--- a/
src/olsrd.c
+++ b/
src/olsrd.c
@@
-154,8
+154,6
@@
static FILE *olsrd_connect (void) /* {{{ */
FILE *fh;
FILE *fh;
- ai_list = NULL;
-
struct addrinfo ai_hints = {
.ai_family = PF_UNSPEC,
.ai_flags = AI_ADDRCONFIG,
struct addrinfo ai_hints = {
.ai_family = PF_UNSPEC,
.ai_flags = AI_ADDRCONFIG,
diff --git
a/src/pinba.c
b/src/pinba.c
index
6a4ebfc
..
66170bf
100644
(file)
--- a/
src/pinba.c
+++ b/
src/pinba.c
@@
-360,8
+360,6
@@
static pinba_socket_t *pinba_socket_open (const char *node, /* {{{ */
if (service == NULL)
service = PINBA_DEFAULT_SERVICE;
if (service == NULL)
service = PINBA_DEFAULT_SERVICE;
- ai_list = NULL;
-
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC,
.ai_flags = AI_PASSIVE,
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC,
.ai_flags = AI_PASSIVE,
diff --git
a/src/statsd.c
b/src/statsd.c
index
285486d
..
8acd9fd
100644
(file)
--- a/
src/statsd.c
+++ b/
src/statsd.c
@@
-500,7
+500,7
@@
static int statsd_network_init (struct pollfd **ret_fds, /* {{{ */
struct pollfd *fds = NULL;
size_t fds_num = 0;
struct pollfd *fds = NULL;
size_t fds_num = 0;
- struct addrinfo *ai_list
= NULL
;
+ struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
int status;
struct addrinfo *ai_ptr;
int status;
diff --git
a/src/write_graphite.c
b/src/write_graphite.c
index
efdd4d8
..
f890b97
100644
(file)
--- a/
src/write_graphite.c
+++ b/
src/write_graphite.c
@@
-220,8
+220,6
@@
static int wg_callback_init (struct wg_callback *cb)
else
ai_hints.ai_socktype = SOCK_DGRAM;
else
ai_hints.ai_socktype = SOCK_DGRAM;
- ai_list = NULL;
-
status = getaddrinfo (cb->node, cb->service, &ai_hints, &ai_list);
if (status != 0)
{
status = getaddrinfo (cb->node, cb->service, &ai_hints, &ai_list);
if (status != 0)
{
diff --git
a/src/write_tsdb.c
b/src/write_tsdb.c
index
fe418cf
..
401e875
100644
(file)
--- a/
src/write_tsdb.c
+++ b/
src/write_tsdb.c
@@
-165,8
+165,6
@@
static int wt_callback_init(struct wt_callback *cb)
if (cb->sock_fd > 0)
return 0;
if (cb->sock_fd > 0)
return 0;
- ai_list = NULL;
-
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC,
.ai_flags = AI_ADDRCONFIG,
struct addrinfo ai_hints = {
.ai_family = AF_UNSPEC,
.ai_flags = AI_ADDRCONFIG,